Adds promise support to API methods