diff --git a/kadmos/vistoms/templates/VISTOMS.html b/kadmos/vistoms/templates/VISTOMS.html
index 23fc25996fe98321d12e0e4a0327f128f2e4040f..f9b934807e4d14b367679be2b271bc55b2ec551c 100644
--- a/kadmos/vistoms/templates/VISTOMS.html
+++ b/kadmos/vistoms/templates/VISTOMS.html
@@ -63,18 +63,15 @@
               <div style="font-size:14pt" class="dropdown-menu" aria-labelledby="addGraph">
                 <a id="from_scratch" class="dropdown-item" onmouseover=""  style="cursor: pointer;">Create graph from scratch</a>
                 <a id="kdms_upload" class="dropdown-item" onmouseover=""  style="cursor: pointer;">Upload KDMS file(s)</a>
-                <a id="cmdows_upload" class="dropdown-item" onmouseover=""  style="cursor: pointer;">Upload CMDOWS file</a>
+                <a id="cmdows_upload" class="dropdown-item" onmouseover=""  style="cursor: pointer;">Upload CMDOWS file(s)</a>
                 <a id="database_upload" class="dropdown-item" onmouseover=""  style="cursor: pointer;">Upload database (zip-file)</a>
               </div>              
           </div>
-           <div id="save_dropdown" style="margin-left: 10pt; float:left; visibility:hidden" class="dropdown">
-              <button style="font-size:18pt" class="btn btn-secondary dropdown-toggle" type="button" id="saveGraphs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-                Save
-              </button>
-              <div style="font-size:14pt" class="dropdown-menu" aria-labelledby="saveGraphs">
-                <a id="kdms_save" class="dropdown-item" onmouseover=""  style="cursor: pointer;">All graphs as KDMS files for download</a>
-                <a id="cmdows_save" class="dropdown-item" onmouseover=""  style="cursor: pointer;">All graphs as CMDOWS files for download</a>
-              </div>              
+          <div id="save_div" style="margin-left: 10pt; float:left; visibility:hidden" class="dropdown">
+              <a style="font-size:18pt; color:white" class="btn btn-secondary" type="button" id="save_button">Save</a>           
+          </div>
+		  <div id="delete_div" style="margin-left: 10pt; float:left; visibility:hidden">
+              <a style="font-size:18pt; color:white" class="btn btn-secondary" type="button" id="delete_button">Delete</a>
           </div>
           
         </ul>
@@ -105,7 +102,7 @@
 			var interfaceMode = {{ interfaceMode|tojson }};
             if (bowser.name=="Internet Explorer")
 			{
-                alert("OOPS! VISTOMS unfortunately does not work properly on " + bowser.name + ". Please use a different browser to see its awesome visualization features!")
+                alert("OOPS! The MDO System Interface unfortunately does not work properly on " + bowser.name + ". Please use a different browser to see its awesome visualization features!")
 			}
             /* see docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage */
 			if (window && window.localStorage && interfaceMode==='server')
@@ -238,6 +235,63 @@
                     }
                 });
             }
+			
+			function delete_graphs(graphIDs)
+			{
+				var bootboxContent = {title: "Deleting graphs", message: '<p>Please be patient...</p>'};
+				bootbox.hideAll();
+				bootbox.confirm("Are you sure you want to permanently delete these graphs? <b>This cannot be reverted!</b>", function(sure)
+				{
+					if (sure)
+					{   
+						graphIDs_str = JSON.stringify(graphIDs)
+						var xhr = $.ajax(
+						{
+							type: 'POST',
+							url: '/kadmos_delete_graphs',
+							data: {'graphIDs':graphIDs_str, 'sessionId': sessionId},
+							success: function(result)
+							{
+								if (result.includes("ERROR:"))
+								{
+									bootboxContent.message = result
+									kadmosErrorMessage(bootboxContent);
+								}
+								else
+								{                                        
+									var dataArray = result;       
+									var data = []
+									if (dataArray.length == 0){data="REP__GRAPH_DATA__REP"}
+									else{data = {"graphs":[], "categories":""};}
+									for (var i = 0; i < dataArray.length; i++)
+									{
+										var data_tmp = JSON.parse(dataArray[i])
+										data.graphs.push(data_tmp.graphs[0]);
+										if (data.categories == [])
+										{
+											data.categories = data_tmp.categories;                                        
+										}
+									}
+									
+									clearView();
+									makeKadmosMenu(data);
+									mainPage();
+									
+									bootboxContent.message = "Graphs were sucessfully deleted!"
+									kadmosSuccessMessage(bootboxContent)
+								}
+							},
+							error: function(result)
+							{
+								bootboxContent.message = result
+								kadmosErrorMessage(bootboxContent);
+							}
+						});
+						kadmosHavePatience(xhr, bootboxContent)
+					}
+				})
+				
+			}
             //##############################################################
              
             //aigner: Function to filter a list with a search
@@ -412,10 +466,18 @@
 				})
 				//##########################################################               
                 
+				//aigner: Remove save and delete buttons at first
+				//##########################################################
+				var save_div = d3.select("#save_div")
+				save_div.style("visibility","hidden")
+				var delete_div = d3.select("#delete_div")
+				delete_div.style("visibility","hidden")
+				//##########################################################
+				
                 var tmpGraphsAvailable = false;
 				if (initial)
                 {
-                    var bootboxContent = {title: "VISTOMS start", message: '<p>Please be patient...</p>'};
+                    var bootboxContent = {title: "Session start", message: '<p>Please be patient...</p>'};
                     var xhr = $.ajax({
                         type: 'POST',
                         url: '/kadmos_find_temp_graphs',
@@ -448,17 +510,17 @@
                                 
                                 if (tmpGraphsAvailable)
                                 {
-                                    bootboxContent.title = "VISTOMS ready"
-                                    bootboxContent.message = "KADMOS found already existing VISTOMS graphs. You can select them from the drop-down menu."
+                                    bootboxContent.title = "Interface ready!"
+                                    bootboxContent.message = "There are already existing graphs. You can select them from the drop-down menu."
                                     kadmosSuccessMessage(bootboxContent)
                                 }
                                 else {bootbox.hideAll();}
-                                
                                 //aigner: make dropwdown section for the multiple MDO graphs tzhat can be visualized
                                 make_open_button(data);
                                 //aigner: Add special button to open graphs from kdms or cmdows files
                                 add_graph_dropdown(data.graphs);
-                                save_graph_dropdown(data.graphs);
+                                save_graphs_dropdown(data.graphs);
+                                delete_graphs_dropdown(data.graphs);
                             }
                         },
                         error: function(result)
@@ -475,7 +537,8 @@
                     make_open_button(data);
                     //aigner: Add special button to open graphs from kdms or cmdows files
                     add_graph_dropdown(data.graphs);
-                    save_graph_dropdown(data.graphs);
+                    save_graphs_dropdown(data.graphs);
+                    delete_graphs_dropdown(data.graphs);
                 }
                 
                 
@@ -500,7 +563,7 @@
                                 bootbox.hideAll();
                                 bootbox.dialog({
                                     closeButton: false,
-                                    message: "No graph to inspect in VISTOMS yet! \nYou can add a graph by uploading a KDMS or CMDOWS file.",
+                                    message: "No graph to inspect yet! \nYou can add a graph by uploading a KDMS or CMDOWS file.",
                                     buttons : { cancel:
                                                 {
                                                     label: "OK",
@@ -525,7 +588,6 @@
                                 .on("mouseover", function(){d3.select(this).style("cursor", "pointer")})
                                 .on("click", function()
                                 {
-                                    //@Aigner: HIER WEITER!!!
                                         bootbox.prompt({
                                         closeButton: false,
                                         title: "Please select the visualization type",
@@ -734,10 +796,10 @@
                     {
                         //aigner: Upload file to VISTOMS and inspect it
                         //##########################################################
-                        var bootboxContent = {title: "Upload file to VISTOMS", message: '<p>Please be patient...</p>'};
+                        var bootboxContent = {title: "Upload file to interface", message: '<p>Please be patient...</p>'};
                         var xhr = $.ajax({
                             type: 'POST',
-                            url: '/kadmos_upload_file',
+                            url: '/kadmos_upload_files',
                             data: formData,
                             processData: false,
                             contentType: false,
@@ -746,7 +808,6 @@
                                 if (result.includes("ERROR:"))
                                 {
                                     
-                                    
                                     bootboxContent.message = result
                                     kadmosErrorMessage(bootboxContent);
                                     
@@ -756,18 +817,22 @@
                                 }
                                 else
                                 {
-                                    var updatedData = {};
-                                    if (data != "REP__GRAPH_DATA__REP")
-                                    {
-                                        updatedData = data;
-                                        var graphData = JSON.parse(result);                                        
-                                        updatedData.graphs.push(graphData.graphs[0]);                                        
-                                    }
-                                    else
-                                    {
-                                        updatedData = JSON.parse(result);
-                                    }
-                                    
+									var dataArray = result;        
+									var updatedData = {};
+									if (data != "REP__GRAPH_DATA__REP")
+									{
+										updatedData = data;
+									}
+									else
+									{
+										updatedData = {"graphs":[], "categories":""};
+									}
+									for (var i = 0; i < dataArray.length; i++)
+									{
+										var graphData = JSON.parse(dataArray[i]);       
+										updatedData.graphs.push(graphData.graphs[0]); 
+									}
+									                                    
                                     clearView();
                                     makeKadmosMenu(updatedData);
                                     mainPage();
@@ -788,75 +853,148 @@
                     }
                     
                 }
-                
-                function save_graph_dropdown(theGraphs)
-                {                    
+				
+				function save_graphs_dropdown(theGraphs)
+				{
+					function save_graphs(graphNames, graphIDs, fileType)
+					{
+						var graphIDs_str = JSON.stringify(graphIDs)
+						var graphNames_str = JSON.stringify(graphNames)
+						//aigner: Saving files
+						//##########################################################
+						bootbox.hideAll();
+						var bootboxContent = {title: "Save graph", message: '<p>Please be patient...</p>'};
+						var xhr = $.ajax(
+						{
+							type: 'POST',
+							data: {'fileNames_str':graphNames_str, 'graphIDs_str':graphIDs_str, 'fileType': fileType, 'sessionId': sessionId},
+							url: '/kadmos_export_graphs',
+							success: function(result)
+							{                  
+								var files = result
+								files.forEach(function(file)
+								{
+									download_from_kadmos(file,"/kadmos_download/"+file+"/"+sessionId)
+								})
+								
+								
+								if (result.includes("ERROR:"))
+								{
+									bootboxContent.message = result
+									kadmosErrorMessage(bootboxContent);
+								}
+								else
+								{
+									bootboxContent.message = "Successfully created the files. Ready for download."
+									bootbox.hideAll();
+									bootbox.confirm(
+									{
+										closeButton: false,
+										title: bootboxContent.title,
+										message: bootboxContent.message,
+										callback: function(){
+											remove_obsolete_files()
+										}
+									});
+								}
+							},
+							error: function(result)
+							{
+								bootboxContent.message = result
+								kadmosErrorMessage(bootboxContent);
+							}
+						});
+						kadmosHavePatience(xhr, bootboxContent)
+						//##########################################################
+					}
+					
                     if (theGraphs)
                     {
-                        var save_dropdown = d3.select("#save_dropdown")
-                        save_dropdown.style("visibility","visible")
-                        
-                        d3.select("#kdms_save").on("mousedown", function()
+						var options = []
+                        theGraphs.forEach(function(theGraph)
                         {
-                            save_graphs("KDMS")
+							options.push({text:theGraph.name, value:theGraph.id})
                         })
-                        d3.select("#cmdows_save").on("mousedown", function()
+						
+                        var save_div = d3.select("#save_div")
+                        save_div.style("visibility","visible")
+						var save_button = d3.select("#save_button")
+						save_button.on("mousedown", function()
                         {
-                            save_graphs("CMDOWS")
+                            bootbox.hideAll();
+							bootbox.prompt({
+								closeButton: false,
+								title: "Which graphs should be saved?",
+								inputType: 'checkbox',
+								inputOptions: options,
+								callback: function (graphIDs) {
+									if (graphIDs != null)
+									{	
+										graphNames = []
+										theGraphs.forEach(function(theGraph)
+										{
+											if (graphIDs.indexOf(theGraph.id) > -1)
+											{
+												graphNames.push(theGraph.name)
+											}
+										})
+										bootbox.prompt({
+											closeButton: false,
+											title: "Please select a filetype",
+											inputType: 'select',
+											inputOptions: [{text:"Please choose...", value:"-"},
+											               {text:"CMDOWS", value:"cmdows"},
+														   {text:"KDMS", value:"kdms"}],
+											value: "-",
+											callback: function (filetype) {
+												if (filetype != null)
+												{
+													save_graphs(graphNames,graphIDs,filetype)
+													//@aigner: HIER WEITER!!!
+												}
+											}
+										});
+									}
+								}
+							});
                         })
-                        
-                        function save_graphs(fileType)
+                    }
+				}
+				
+				
+				
+				function delete_graphs_dropdown(theGraphs)
+				{
+                    if (theGraphs)
+                    {
+						var options = []
+                        theGraphs.forEach(function(theGraph)
+                        {
+							options.push({text:theGraph.name, value:theGraph.id})
+                        })
+						
+                        var delete_div = d3.select("#delete_div")
+                        delete_div.style("visibility","visible")
+						var delete_button = d3.select("#delete_button")
+						delete_button.on("mousedown", function()
                         {
-                            //aigner: Saving files
-                            //##########################################################
                             bootbox.hideAll();
-                            var bootboxContent = {title: "Save graph", message: '<p>Please be patient...</p>'};
-                            var xhr = $.ajax(
-                            {
-                                type: 'POST',
-                                data: {'fileType': fileType, 'sessionId': sessionId},
-                                url: '/kadmos_export_all_graphs',
-                                success: function(result)
-                                {                  
-                                    var files = result
-                                    console.log(files)
-                                    files.forEach(function(file)
-                                    {
-                                        download_from_kadmos(file,"/kadmos_download/"+file+"/"+sessionId)
-                                    })
-                                    
-                                    
-                                    if (result.includes("ERROR:"))
-                                    {
-                                        bootboxContent.message = result
-                                        kadmosErrorMessage(bootboxContent);
-                                    }
-                                    else
-                                    {
-                                        bootboxContent.message = "Successfully created the files. Ready for download."
-                                        bootbox.hideAll();
-                                        bootbox.confirm(
-                                        {
-                                            closeButton: false,
-                                            title: bootboxContent.title,
-                                            message: bootboxContent.message,
-                                            callback: function(){
-                                                remove_obsolete_files()
-                                            }
-                                        });
-                                    }
-                                },
-                                error: function(result)
-                                {
-                                    bootboxContent.message = result
-                                    kadmosErrorMessage(bootboxContent);
-                                }
-                            });
-                            kadmosHavePatience(xhr, bootboxContent)
-                            //##########################################################
-                        }
+							bootbox.prompt({
+								closeButton: false,
+								title: "Which graphs should be deleted?",
+								inputType: 'checkbox',
+								inputOptions: options,
+								callback: function (graphIDs) {
+									if (graphIDs != null)
+									{
+										delete_graphs(graphIDs)
+										//@aigner: HIER WEITER!!!
+									}
+								}
+							});
+                        })
                     }
-                }
+				}
             }
 			//##########################################################
 
@@ -1129,7 +1267,6 @@
                 if (acknowledgements){acknowledgements.remove();}
                 var footer = d3.select("footer");
 				if (footer){footer.remove();}
-                
 			}
 			//#####################################################################//
 		
@@ -19965,10 +20102,7 @@
                                 value: 'sankeyDiagram',
                             }
                         ],
-                        callback: function (theView) {
-                            console.log(data)
-                            console.log(currentGraph)
-                            
+                        callback: function (theView) {                            
                             if (theView == "xdsm")
                             {
                                 clearView();
@@ -20017,9 +20151,9 @@
                     var xhr = $.ajax(
                     {
                         type: 'POST',
-                        data: {'fileName':currentGraph.name, 'fileType': fileType, 'graphID': graphID,
+                        data: {'fileNames_str':JSON.stringify([currentGraph.name]), 'fileType': fileType, 'graphIDs_str': JSON.stringify([currentGraph.id]),
                             'sessionId': sessionId},
-                        url: '/kadmos_export_graph',
+                        url: '/kadmos_export_graphs',
                         success: function(result)
                         {                
                             var files = result
@@ -20078,7 +20212,7 @@
                         closeButton: false,
                         title: "Save graph. What would you like to save the graph as?",
                         inputType: 'select',
-                        inputOptions: [ {text:" Save as new VISTOMS graph",value:"VISTOMS"},
+                        inputOptions: [ {text:" Save as new graph",value:"VISTOMS"},
                                         {text:"Save as KDMS file (download)",value:"kdms"},
                                         {text:"Save as CMDOWS file (download)",value:"cmdows"}],
                         value: "VISTOMS",
@@ -20114,7 +20248,7 @@
                                     bootbox.dialog({
                                         closeButton: false,
                                         message: $(".form-content").html(),
-                                        title: "<p>The graph will be saved as new VISTOMS graph"
+                                        title: "<p>The graph will be saved in the MDO System Interface"
                                               +"<p>Please type in a new name and description for the graph</p>",
                                         size: "large",
                                         buttons: [
@@ -20135,7 +20269,7 @@
                                                 var graph_description = $('form #graph_description').val();
                                                 
                                                 
-                                                var bootboxContent = {title: "Save as new VISTOMS graph", message: '<p>Please be patient...</p>'};
+                                                var bootboxContent = {title: "Save as new graph", message: '<p>Please be patient...</p>'};
                                                 var newGraphID = ""
                                                 if (data.graphs.length<100){newGraphID="0"+String(data.graphs.length+1)}
                                                 else {newGraphID=String(data.graphs.length+1)}
@@ -20222,57 +20356,7 @@
                     .attr("aria-hidden","true")
                 deleteButton.on("mousedown", function()
                 {
-                    var bootboxContent = {title: "Deleting graph", message: '<p>Please be patient...</p>'};
-                    bootbox.hideAll();
-                    bootbox.confirm("Are you sure you want to permanently delete the graph? <b>This cannot be reverted!</b>", function(sure)
-                    {
-                        if (sure)
-                        {   
-                            var xhr = $.ajax(
-                            {
-                                type: 'POST',
-                                url: '/kadmos_delete_graph',
-                                data: {'graphID':graphID, 'sessionId': sessionId},
-                                success: function(result)
-                                {
-                                    if (result.includes("ERROR:"))
-                                    {
-                                        bootboxContent.message = result
-                                        kadmosErrorMessage(bootboxContent);
-                                    }
-                                    else
-                                    {                                        
-                                        var dataArray = result;       
-                                        var data = []
-                                        if (dataArray.length == 0){data="REP__GRAPH_DATA__REP"}
-                                        else{data = {"graphs":[], "categories":""};}
-                                        for (var i = 0; i < dataArray.length; i++)
-                                        {
-                                            var data_tmp = JSON.parse(dataArray[i])
-                                            data.graphs.push(data_tmp.graphs[0]);
-                                            if (data.categories == [])
-                                            {
-                                                data.categories = data_tmp.categories;                                        
-                                            }
-                                        }
-                                        
-                                        clearView();
-                                        makeKadmosMenu(data);
-                                        mainPage();
-                                        
-                                        bootboxContent.message = "Graph was sucessfully deleted!"
-                                        kadmosSuccessMessage(bootboxContent)
-                                    }
-                                },
-                                error: function(result)
-                                {
-                                    bootboxContent.message = result
-                                    kadmosErrorMessage(bootboxContent);
-                                }
-                            });
-                            kadmosHavePatience(xhr, bootboxContent)
-                        }
-                    })
+					delete_graphs([graphID]);
                 })
                 
                 
@@ -21158,6 +21242,18 @@
                             {
                                 currentGraph.organization.contacts = [];
                             }
+							if (typeof currentGraph.organization.organigram.architects=="undefined")
+                            {
+                                currentGraph.organization.organigram.architects = [];
+                            }
+                            if (typeof currentGraph.organization.organigram.integrators=="undefined")
+                            {
+                                currentGraph.organization.organigram.integrators = [];
+                            }
+                            if (typeof currentGraph.organization.organigram.toolSpecialists=="undefined")
+                            {
+                                currentGraph.organization.organigram.toolSpecialists = [];
+                            }
                             
                             //Show contact info
                             //############################################################
@@ -24714,10 +24810,7 @@
                                 value: 'sankeyDiagram',
                             }
                         ],
-                        callback: function (theView) {
-                            console.log(data)
-                            console.log(currentGraph)
-                            
+                        callback: function (theView) {                            
                             if (theView == "xdsm")
                             {
                                 clearView();
@@ -29296,10 +29389,7 @@
                                 value: 'sankeyDiagram',
                             }
                         ],
-                        callback: function (theView) {
-                            console.log(data)
-                            console.log(currentGraph)
-                            
+                        callback: function (theView) {                            
                             if (theView == "xdsm")
                             {
                                 clearView();
diff --git a/kadmos/vistoms/vistoms.py b/kadmos/vistoms/vistoms.py
index 886a9ec96cff4e894630c17c5bb4c1e846c5e178..ebfdb6abd1e92db4b9929efa11b539cc3a7fe20d 100644
--- a/kadmos/vistoms/vistoms.py
+++ b/kadmos/vistoms/vistoms.py
@@ -131,8 +131,8 @@ def interface(debug=True, tempdir=None):
     def acknowledgements():
         return render_template('acknowledgements.html', page='acknowledgements')
 
-    @app.route('/kadmos_upload_file', methods=['GET', 'POST'])
-    def kadmos_upload_file():
+    @app.route('/kadmos_upload_files', methods=['GET', 'POST'])
+    def kadmos_upload_files():
         """
             Function uploads a file to the temp folder and returns the graph information to VISTOMS
 
@@ -146,36 +146,22 @@ def interface(debug=True, tempdir=None):
                 session_id = request.form['sessionId']
                 uploaded_files = request.files.getlist("file[]")
 
-                number_of_files = len(uploaded_files)
-                if number_of_files > 2:
-                    return "ERROR: Max. number of files that can be uploaded is 2!"
-
-                mpgFile = []
-                dgFile = []
-                for file in uploaded_files:
-                    if "_mpg" in file.filename:
-                        mpgFile = file
-                    else:
-                        dgFile = file
+                session_folder = retrieve_session_folder(SESSIONS_CATALOG_FOLDER, session_id)
 
                 # check if the post request has the file part
                 if 'file[]' not in request.files:
-                   return "ERROR: No file part!"
-
-                # if user does not select file, browser also
-                # submit a empty part without filename
-                if dgFile.filename == '':
                     return "ERROR: No file part!"
-                if dgFile:
-                    # Check if the right filetypes were chosen
-                    if fileType == 'CMDOWS file' and dgFile.filename.rsplit('.', 1)[1].lower() != "xml":
-                        return "ERROR: Wrong file type! Please use a valid CMDOWS file"
-                    elif fileType == 'KDMS file(s)' and dgFile.filename.rsplit('.', 1)[1].lower() != "kdms":
-                        return "ERROR: Wrong file type! Please use a valid KDMS file"
-                    elif fileType == 'Database' and dgFile.filename.rsplit('.', 1)[1].lower() != "zip":
-                        return "ERROR: Wrong file type! Please use a valid zip file"
 
-                    session_folder = retrieve_session_folder(SESSIONS_CATALOG_FOLDER, session_id)
+                newVistomsDataArray = []
+
+                if fileType == 'Database':
+                    if len(uploaded_files) > 1:
+                        return "ERROR: You can upload only one ZIP-file!"
+                    file = {}
+                    for aFile in uploaded_files:
+                        file = aFile
+                    if file.filename.rsplit('.', 1)[1].lower() != "zip":
+                        return "ERROR: Wrong file type! Please use a valid zip file"
 
                     database_dir = ""
                     if fileType == 'Database':
@@ -198,50 +184,96 @@ def interface(debug=True, tempdir=None):
 
                         cmdows_file = find_cmdows_file(file_list)
                         graphFileName = cmdows_file
-                    else:
-                        graphFileName = os.path.join(session_folder, dgFile.filename)
-                        dgFile.save(os.path.join(session_folder, dgFile.filename))
-
-                    loaded_graph = load(graphFileName, file_check_critical=False)
-                    if isinstance(loaded_graph, tuple):
-                        graph = loaded_graph[0]
-                        mpg = loaded_graph[1]
-                    elif mpgFile:
-                        # Check if the right filetype was chosen
-                        if mpgFile.filename.rsplit('.', 1)[1].lower() != "kdms":
-                            return "ERROR: Wrong file type! Please use a valid KDMS file"
-                        graph = loaded_graph
-                        mpgFileName = mpgFile.filename
-                        mpgFile.save(os.path.join(session_folder, mpgFileName))
-                        mpg = load(os.path.join(session_folder, mpgFileName), file_check_critical=True)
-                        # Remove the uploaded file from the temp folder
-                        os.remove(os.path.join(session_folder, mpgFileName))
-                    else:
-                        graph = loaded_graph
-                        mpg = None
-
-                    if "name" not in graph.graph:
-                        graph.graph["name"] = os.path.splitext(dgFile.filename)[0].replace("_",".")
-                    # Remove the uploaded file (and if existing, database directory) from the temp folder
-                    os.remove(graphFileName)
-                    if os.path.exists(database_dir):
-                        shutil.rmtree(database_dir)
-
-                    #save the graph as kdms file in temp folder
-                    graph.save(os.path.join(session_folder, TEMP_FILE + '_' + newGraphID + '.kdms'), file_type='kdms',
-                               graph_check_critical=False, mpg=mpg)
 
-                    # Use function order for VISTOMS if it is available in the graph information
-                    function_order = None
-                    if graph.graph_has_nested_attributes('problem_formulation', 'function_order') and mpg==None:
-                        function_order = graph.graph['problem_formulation']['function_order']
+                        loaded_graph = load(graphFileName, file_check_critical=False)
+                        if isinstance(loaded_graph, tuple):
+                            graph = loaded_graph[0]
+                            mpg = loaded_graph[1]
+                        else:
+                            graph = loaded_graph
+                            mpg = None
 
-                    # Add the graph with the updated function order to VISTOMS
-                    newVistomsData = graph.vistoms_add_json(graph_id=newGraphID, function_order=function_order, mpg=mpg)
+                        if "name" not in graph.graph:
+                            graph.graph["name"] = os.path.split(os.path.splitext(graphFileName)[0].replace("_", "."))[1]
+                        # Remove the uploaded file (and if existing, database directory) from the temp folder
+                        os.remove(graphFileName)
+                        if os.path.exists(database_dir):
+                            shutil.rmtree(database_dir)
 
-                    return newVistomsData
+                        # save the graph as kdms file in temp folder
+                        graph.save(os.path.join(session_folder, TEMP_FILE + '_' + newGraphID + '.kdms'),
+                                   file_type='kdms',
+                                   graph_check_critical=False, mpg=mpg)
+                        # Increase graphID by 1
+                        newGraphID = str(int(newGraphID) + 1)
 
-            return "ERROR: File type " + dgFile.filename.rsplit('.', 1)[1].lower() + " not allowed!"
+                        # Use function order for VISTOMS if it is available in the graph information
+                        function_order = None
+                        if graph.graph_has_nested_attributes('problem_formulation',
+                                                             'function_order') and mpg == None:
+                            function_order = graph.graph['problem_formulation']['function_order']
+
+                        # Add the graph with the updated function order to VISTOMS
+                        newVistomsDataArray.append(graph.vistoms_add_json(graph_id=newGraphID, function_order=function_order,
+                                                                mpg=mpg))
+                else:
+                    file_names = []
+                    for file in uploaded_files:
+                        file_names.append(file.filename)
+                    for file in uploaded_files:
+                        if "_mpg" in file.filename:
+                            # Do nothing if it is an _mpg file
+                            continue
+                        else:
+                            dgFile = file
+                            # Check if the right filetypes were chosen
+                            if fileType == 'CMDOWS file' and dgFile.filename.rsplit('.', 1)[1].lower() != "xml":
+                                return "ERROR: Wrong file type! Please use a valid CMDOWS file"
+                            elif fileType == 'KDMS file(s)' and dgFile.filename.rsplit('.', 1)[1].lower() != "kdms":
+                                return "ERROR: Wrong file type! Please use a valid KDMS file"
+
+                            graph_file = os.path.join(session_folder, dgFile.filename)
+                            dgFile.save(os.path.join(session_folder, dgFile.filename))
+
+                            loaded_graph = load(graph_file, file_check_critical=False)
+                            if isinstance(loaded_graph, tuple):
+                                graph = loaded_graph[0]
+                                mpg = loaded_graph[1]
+                            else:
+                                mpgFileName = os.path.split(os.path.splitext(dgFile.filename)[0])[1]+'_mpg.kdms'
+                                if mpgFileName in file_names:
+                                    index = file_names.index(mpgFileName)
+                                    uploaded_files[index].save(os.path.join(session_folder, mpgFileName))
+                                    graph = loaded_graph
+                                    mpg = load(os.path.join(session_folder, mpgFileName), file_check_critical=False)
+                                    os.remove(os.path.join(session_folder, mpgFileName))
+                                else:
+                                    graph= loaded_graph
+                                    mpg = None
+
+                            if "name" not in graph.graph:
+                                graph.graph["name"] = os.path.splitext(dgFile.filename)[0].replace("_", ".")
+
+                            # Remove the uploaded file (and if existing, database directory) from the temp folder
+                            os.remove(graph_file)
+
+                            # save the graph as kdms file in temp folder
+                            graph.save(os.path.join(session_folder, TEMP_FILE + '_' + newGraphID + '.kdms'),
+                                       file_type='kdms',
+                                       graph_check_critical=False, mpg=mpg)
+                            # Use function order for VISTOMS if it is available in the graph information
+                            function_order = None
+                            if graph.graph_has_nested_attributes('problem_formulation',
+                                                                 'function_order') and mpg == None:
+                                function_order = graph.graph['problem_formulation']['function_order']
+
+                            # Add the graph with the updated function order to VISTOMS
+                            newVistomsDataArray.append(graph.vistoms_add_json(graph_id=newGraphID, function_order=function_order,
+                                                                    mpg=mpg))
+                            # Increase graphID by 1
+                            newGraphID = str(int(newGraphID) + 1).zfill(2)
+
+                return jsonify(newVistomsDataArray)
 
         except Exception as e:
             return "ERROR: " + e.message
@@ -285,8 +317,8 @@ def interface(debug=True, tempdir=None):
             return "ERROR: " + e.message
             # Logs the error appropriately.
 
-    @app.route('/kadmos_export_all_graphs', methods=['POST'])
-    def kadmos_export_all_graphs():
+    @app.route('/kadmos_export_graphs', methods=['POST'])
+    def kadmos_export_graphs():
         """
            Function exports all graphs to a folder as CMDOWS or KDMS files
 
@@ -295,74 +327,24 @@ def interface(debug=True, tempdir=None):
         """
         try:
             # Get request form
+            fileNames_str = request.form['fileNames_str']
+            graphIDs_str = request.form['graphIDs_str']
             fileType = request.form['fileType']
             session_id = request.form['sessionId']
 
-            session_folder = retrieve_session_folder(SESSIONS_CATALOG_FOLDER, session_id)
 
+
+            graphIDs = json.loads(graphIDs_str)
+            fileNames = json.loads(fileNames_str)
             files = []
-            for aFile in os.listdir(session_folder):
-                if aFile.endswith(".kdms"):
-                    fileName = aFile.split('.')[0]
-                    fileName_split = fileName.split('_')
-                    if "mpg" not in fileName_split and "backup" not in fileName_split: # Do not loop through mpg files
-                        graphFileName = fileName + ".kdms"
-                        mpgFileName = fileName + "_mpg.kdms"
-                        if os.path.exists(os.path.join(session_folder, mpgFileName)):
-                            graph = load(os.path.join(session_folder, graphFileName), file_check_critical=False)
-                            mpg = load(os.path.join(session_folder, mpgFileName), file_check_critical=False)
-                        else:
-                            graph = load(os.path.join(session_folder, graphFileName), file_check_critical=False)
-                            mpg = None
+            counter = 0
+            for graphID in graphIDs:
+                fileName = fileNames[counter]
+                file_arr = kadmos_export_graph(fileName=fileName, graphID=graphID, fileType=fileType, session_id=session_id)
+                for file in file_arr:
+                    files.append(file)
+                counter += 1
 
-                        # Add problem function roles if they are not already existing
-                        if not hasattr(graph, 'name'):
-                            graph_name = fileName
-                        else:
-                            graph_name = graph.name
-                        # Add problem function roles if they are not already existing
-                        if isinstance(graph, FundamentalProblemGraph):
-                            if 'function_order' not in graph.graph['problem_formulation']:
-                                graph.assert_or_add_nested_attribute(['problem_formulation', 'function_order'],
-                                                                 None)
-                            if 'mdao_architecture' not in graph.graph['problem_formulation']:
-                                graph.assert_or_add_nested_attribute(['problem_formulation', 'mdao_architecture'],
-                                                                 'undefined')
-                            if 'allow_unconverged_couplings' not in graph.graph['problem_formulation']:
-                                graph.assert_or_add_nested_attribute(['problem_formulation', 'allow_unconverged_couplings'],
-                                                                 False)
-                            graph.add_function_problem_roles()
-
-                        if fileType == "CMDOWS":
-                            file_type = "cmdows"
-                            file = graph_name + ".xml"
-                            # Save as CMDOWS file
-                            file_copy = file
-                            count = 0
-                            while os.path.exists(os.path.join(session_folder, file_copy)):
-                                count += 1
-                                file_copy = graph_name + "(" + str(count) + ")" + ".xml"
-                            graph.save(os.path.join(session_folder, file_copy), file_type=file_type,
-                                       graph_check_critical=False, mpg=mpg)
-                            files.append(file_copy)
-
-                        elif fileType == "KDMS":
-                            file_type = "kdms"
-                            file = graph_name + ".kdms"
-                            mpgfile = graph_name + "_mpg.kdms"
-                            # Save as kdms file
-                            file_copy = file
-                            mpgfile_copy = mpgfile
-                            count = 0
-                            while os.path.exists(os.path.join(session_folder, file_copy)):
-                                count += 1
-                                file_copy = graph_name + "(" + str(count) + ")" + ".kdms"
-                                mpgfile_copy = graph_name + "(" + str(count) + ")" + "_mpg.kdms"
-                            graph.save(os.path.join(session_folder, file_copy), file_type=file_type,
-                                       graph_check_critical=False, mpg=mpg)
-                            files.append(file_copy)
-                            if mpg is not None:
-                                files.append(mpgfile_copy)
             return jsonify(files)
 
         except Exception as e:
@@ -394,8 +376,7 @@ def interface(debug=True, tempdir=None):
             return "ERROR: " + e.message
             # Logs the error appropriately.
 
-    @app.route('/kadmos_export_graph', methods=['POST'])
-    def kadmos_export_graph():
+    def kadmos_export_graph(fileName, graphID, fileType, session_id):
         """
            Function exports the current graph to a CMDOWS or kdms file
 
@@ -403,11 +384,6 @@ def interface(debug=True, tempdir=None):
            :return: file
         """
         try:
-            # Get request form
-            fileName = request.form['fileName']
-            graphID = request.form['graphID']
-            fileType = request.form['fileType']
-            session_id = request.form['sessionId']
             session_folder = retrieve_session_folder(SESSIONS_CATALOG_FOLDER, session_id)
 
             files = []
@@ -447,7 +423,7 @@ def interface(debug=True, tempdir=None):
             else:
                 return "ERROR: Wrong file type!!!"
 
-            return jsonify(files)
+            return files
 
         except Exception as e:
             return "ERROR: " + e.message
@@ -497,8 +473,8 @@ def interface(debug=True, tempdir=None):
             return "ERROR: " + e.message
             # Logs the error appropriately.
 
-    @app.route('/kadmos_delete_graph', methods=['POST'])
-    def kadmos_delete_graph():
+    @app.route('/kadmos_delete_graphs', methods=['POST'])
+    def kadmos_delete_graphs():
         """
            Function finds all graphs that have been temporarily stored in the temp folder and returns them
            to the VISTOMS package in the browser. This function is always called when the browser is refreshed by the user.
@@ -507,23 +483,25 @@ def interface(debug=True, tempdir=None):
         """
         try:
             # get request form
-            graphID = request.form['graphID']
+            graphIDs_str = request.form['graphIDs']
             session_id = request.form['sessionId']
             session_folder = retrieve_session_folder(SESSIONS_CATALOG_FOLDER, session_id)
 
             tmpDir = session_folder
-            graphFileName = TEMP_FILE + '_' + graphID + '.kdms'
-            backupGraphFileName = TEMP_FILE + '_' + graphID + '_backup.kdms'
-            mpgFileName = TEMP_FILE + '_' + graphID + '_mpg.kdms'
-            backupMpgFileName = TEMP_FILE + '_' + graphID + '_mpg_backup.kdms'
-            if os.path.exists(os.path.join(tmpDir, graphFileName)):
-                os.remove(os.path.join(tmpDir, graphFileName))
-            if os.path.exists(os.path.join(tmpDir, backupGraphFileName)):
-                os.remove(os.path.join(tmpDir, backupGraphFileName))
-            if os.path.exists(os.path.join(tmpDir, mpgFileName)):
-                os.remove(os.path.join(tmpDir, mpgFileName))
-            if os.path.exists(os.path.join(tmpDir, backupMpgFileName)):
-                os.remove(os.path.join(tmpDir, backupMpgFileName))
+            graphIDs = json.loads(graphIDs_str)
+            for graphID in graphIDs:
+                graphFileName = TEMP_FILE + '_' + graphID + '.kdms'
+                backupGraphFileName = TEMP_FILE + '_' + graphID + '_backup.kdms'
+                mpgFileName = TEMP_FILE + '_' + graphID + '_mpg.kdms'
+                backupMpgFileName = TEMP_FILE + '_' + graphID + '_mpg_backup.kdms'
+                if os.path.exists(os.path.join(tmpDir, graphFileName)):
+                    os.remove(os.path.join(tmpDir, graphFileName))
+                if os.path.exists(os.path.join(tmpDir, backupGraphFileName)):
+                    os.remove(os.path.join(tmpDir, backupGraphFileName))
+                if os.path.exists(os.path.join(tmpDir, mpgFileName)):
+                    os.remove(os.path.join(tmpDir, mpgFileName))
+                if os.path.exists(os.path.join(tmpDir, backupMpgFileName)):
+                    os.remove(os.path.join(tmpDir, backupMpgFileName))
 
             return kadmos_find_temp_graphs()
 
@@ -2234,7 +2212,7 @@ def run_vistoms(folder=None, write_log=True, open_vistoms=True):
             os.makedirs(os.path.dirname(SESSIONS_CATALOG_FOLDER))
     # Run the app
     app = interface()
-    app.run(threaded=True, debug=False)
+    app.run(threaded=True, debug=True)
 
 
 # In the app.py (or vistoms.py) I would do it like this at
@@ -2255,6 +2233,7 @@ if __name__ == '__main__':
         assert isinstance(folder, basestring), 'Folder should be a string.'
     else:
         folder = None
+        folder = "C:/Users/aigne/Desktop/VISTOMS/vistoms_tmp"
     # Check if open_vistoms is given in args
     if '-open' in args:
         open_vistoms = args[args.index('-open') + 1]