How-to expand to turn-base game

Options
So, I have JS LoadBalancing Chat Demo (cloud-based) working just fine. I need three 'interfaces' to make my turn-based game : 1) Call StartGame() when a player joins a new game; 2) A function to call to send a string from one player to the other, and 3) call ReceiveString() when it arrives at the other end. What code additions would do this?