Restructured and added websocket server