Send HTTP 500 on server exception, instead of HTTP 404, cleanup