Extract API calls into APIClient class