remove some redundance in json response when an error happens