reg api and event api