Clean import + serialize messages as JSON