put all requests through write_request function