change http_response_writer to accept callback once file has been written to stream