change api function require
write callback and custom event to alert, confirm, prompt