Cleaned up code, working on Client API