implements new url scheme in lib, still supports the former, added a apiversion parameter to the client object