serialize categories