wrap javascript remote actions in a promise api