removed more redundant code, set up all ajax / websocket communication. (only testing on one client / server so far.