call_endpoint function

Call an API Endpoint