updated tests with proper count and accounting
Add websocket functionality