Fixed #569
Used writer instead of outputstream to write response to client, meaning that it inherits the encoding of the main_response object, and thus preserves the UTF-8 encoding of the transform output