adding test for upcoming events, fixing the api endpoint and refactoringz