moved API client to a separate class