Readd 'parent' options for funtions

use metadata.parent_id