migrate to new events api