PHP code to serve moves in JSON from the database.