exposing request function code to the server