Ajax memory game exercise using backend logic