Adding try/catch to HTTP request handler