Converted a bunch of ajax calls to use promises