Ensure all error responses are JSON

Change-Id: I311be55316096b04ca36ce3d10c0332ae874bc78