allows to respond with json when exceptions are thrown in api controllers and with standard error handling in all other cases
allows to respond with json when exceptions are thrown in api controllers and with standard error handling in all other cases