Fixed bugs in api calls before wamp session establishment