send profiling in headers and move calculations to sendHeaders. adjust HTTP status code