Added missing example code.
Promise stuff.