Allow standard promises to work in ajax mode and add ability to return data instead of promise.