made handled errors render 400s and added default error message for 500s