added code for handling ajax requests of the game state