Refactor EndBattleEvent into API