Imrpove client api code