resolves the promise on listen callback with the api instance