parse status code, return json response