fix merge conflicts
change error response to return json
change route errors to return json