API.request function

Run a request to the API