Unify ApiClient to use switch-case