finished the events api