create function for sending web requests