check for invalid json and response code 400