Implement serializeCategory. #14