request function to the server