Metadataservice Implementation

Please review and merge the code