update Api class to use the Client class