extended socket.io functionality

added fsm