Event-driven API for Moai