add simple API to add and update elements
close the app when the elements window is closed