Add callback-based and promise-based API.