JSON error responses

instead of the default HTML ones.