Add API to query for instances and filter by metadata
Merging in changes