saving pruned classes to json