change ajax requests to use promises