Switch to a promise-based API