[apiserver] added sessionmanager handling;
[websocket] added calls to apiserver::onConnect() and apiserver::onClose();