prepare the request as an external function
Move request function to utils