fix new API for connect and close (Prefix and Index management
Still todo save)