Add: ECMAScript 6 promises (2/2): the API