added depth search for type
merge db
added search classes methods to relations