bug fix when get_profile throws error

Fixes
--------
* If `get_profile` fails with an error, pass that error to the controller
* The `auth_required` controller returns the error response as a json