Returns 500 Server Error if exception has no status code
Rename `raw` variable to `payload`
Prepare response payload in separate statement