- refactored api to have a separate client