WIP: new REST client code