added getAllEvents function with pagination