#21 Change memory to use the new client API
Finished the client API.

close #21