Set status code to 400 if there is any error