Added hooks to metadata schema and unit test