API for operation with modal dialogs

This extends on PR #1037 
options = {}