Added Angular promise for ajax calls