make ajax calls return a promise