Move Write Raw Response to after setting contentType