move api to client