Add function to make API call