error handling
set the response status to 500 in the event of a server error