made the API call asynchronous