Resolve with promises instead of using callbacks.

I apologize for this.