added RESTful API.
added javascript for game handling