a major refactoring of the client code. Still need to rework params/url building