Adding hook serverEnd.