updates to error handling in request handler