Updated examples to use promises.