core: serialize arrays to json