supports both callbacks and promises in ajaz calls