[Metadata] Add new API and deprecate old one (#625)