First step towards a new ajax class for api calls

fix of typo in dialog.js