Separated the setting of response headers and the response body. Does not exit/terminate the script anymore.