Add missing apis
Fix event handling
Fix bugs