Fix some deprecation warnings (dep-ann) in api