support nesting in json too (works even mixed)