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.
OK, I don't see how a parser error is different from a semantic error, but I'll take your word for it. Thank you for reviewing this.