Fixed infinite loop, added endpoint to stop game when you lose.