Return json when json is requested

422 (unprocessable_entity) seems like a more appropriate HTTP response code for unparsable json. Also, for a json api, it seems preferable if the response is json instead of an HTML error page.
This is not correct. `unprocessable_entity` is when the request has semantic errors and a parser error is not a semantic error. It fits better with `bad_request`: "The request cannot be fulfilled due to bad syntax."