Implemented working new spec, tested in sepc/usage running api.js and client.js side by side