Building the API client