Support CB serialization both from json and strings