Handle json error responses