added the json response for errors