fix get_terms func > adding json encoder