Retrying ajax calls using the deferred api