ApiClient refactoring