update to events api, only collect events during a trigger period