Move api events and channels to classes.