Adapt latest api changes