Using deferred/promise in client data module