Index: trunk/zoo-project/zoo-kernel/request_parser.c
===================================================================
--- trunk/zoo-project/zoo-kernel/request_parser.c	(revision 965)
+++ trunk/zoo-project/zoo-kernel/request_parser.c	(revision 966)
@@ -204,4 +204,5 @@
 int kvpParseInputs(maps** main_conf,service* s,map *request_inputs,maps** request_output,HINTERNET* hInternet){
   // Parsing inputs provided as KVP
+  map* memory=getMapFromMaps(*main_conf,"main","memory");
   maps *tmpmaps = *request_output;
   map* r_inputs = getMap (request_inputs, "DataInputs");
@@ -342,4 +343,8 @@
 		  }
 		tmpc = strtok (NULL, "@");
+	      }
+	    if(memory!=NULL && strncasecmp(memory->value,"load",4)!=0)
+	      if(getMap(tmpmaps->content,"to_load")==NULL){
+		addToMap(tmpmaps->content,"to_load","false");
 	      }
 	    if (*request_output == NULL)
Index: trunk/zoo-project/zoo-kernel/response_print.c
===================================================================
--- trunk/zoo-project/zoo-kernel/response_print.c	(revision 965)
+++ trunk/zoo-project/zoo-kernel/response_print.c	(revision 966)
@@ -95,4 +95,69 @@
     }
   }
+  printSessionHeaders(m);
+}
+
+/**
+ * Print the Set-Cookie header if necessary (conf["lenv"]["cookie"]) and save 
+ * the session file.
+ * 
+ * The session file (sess_<SESSID>_.cfg where <SESSID> is the cookie value) is
+ * stored in the conf["main"]["tmpPath"] directory.
+ * @param m the main configuration map
+ */
+void printSessionHeaders(maps* m){
+  maps* tmpSess=getMaps(m,"senv");
+  if(tmpSess!=NULL){
+    map *_tmp=getMapFromMaps(m,"lenv","cookie");
+    maps *tmps=getMaps(m,"senv");
+    char* sessId=NULL;
+    if(_tmp!=NULL){
+      printf("Set-Cookie: %s; HttpOnly\r\n",_tmp->value);
+      map *_tmp1=getMapFromMaps(m,"senv","ecookie_length");
+      if(_tmp1!=NULL){
+        int len=atoi(_tmp1->value);
+        int cnt=0;
+        for(cnt=0;cnt<len;cnt++){
+          map* _tmp2=getMapArray(tmps->content,"ecookie",cnt);
+          if(_tmp2!=NULL)
+            printf("Set-Cookie: %s; HttpOnly\r\n",_tmp2->value);
+        }
+      }
+      printf("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"\r\n");
+      char session_file_path[100];
+      char *tmp1=strtok(_tmp->value,";");
+      if(tmp1!=NULL)
+        sprintf(session_file_path,"%s",strstr(tmp1,"=")+1);
+      else
+        sprintf(session_file_path,"%s",strstr(_tmp->value,"=")+1);
+      sessId=zStrdup(session_file_path);
+    }else{
+      maps* t=getMaps(m,"senv");
+      map*p=t->content;
+      while(p!=NULL){
+        if(strstr(p->name,"ID")!=NULL){
+          sessId=zStrdup(p->value);
+          break;
+        }
+        p=p->next;
+      }
+    }
+    char session_file_path[1024];
+    map *tmpPath=getMapFromMaps(m,"main","sessPath");
+    if(tmpPath==NULL)
+      tmpPath=getMapFromMaps(m,"main","tmpPath");
+    sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,sessId);
+    FILE* teste=fopen(session_file_path,"w");
+    if(teste==NULL){
+      char tmpMsg[1024];
+      sprintf(tmpMsg,_("Unable to create the file \"%s\" for storing the session maps."),session_file_path);
+      errorException(m,tmpMsg,"InternalError",NULL);
+      return;
+    }
+    else{
+      fclose(teste);
+      dumpMapsToFile(tmpSess,session_file_path,1);
+    }
+  }  
 }
 
@@ -2665,57 +2730,5 @@
   map* version=getMapFromMaps(m,"main","rversion");
   int vid=getVersionId(version->value);
-  maps* tmpSess=getMaps(m,"senv");
-  if(tmpSess!=NULL){
-    map *_tmp=getMapFromMaps(m,"lenv","cookie");
-    maps *tmps=getMaps(m,"senv");
-    char* sessId=NULL;
-    if(_tmp!=NULL){
-      printf("Set-Cookie: %s; HttpOnly\r\n",_tmp->value);
-      map *_tmp1=getMapFromMaps(m,"senv","ecookie_length");
-      if(_tmp1!=NULL){
-	int len=atoi(_tmp1->value);
-	int cnt=0;
-	for(cnt=0;cnt<len;cnt++){
-	  map* _tmp2=getMapArray(tmps->content,"ecookie",cnt);
-	  if(_tmp2!=NULL)
-	    printf("Set-Cookie: %s; HttpOnly\r\n",_tmp2->value);
-	}
-      }
-      printf("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"\r\n");
-      char session_file_path[100];
-      char *tmp1=strtok(_tmp->value,";");
-      if(tmp1!=NULL)
-	sprintf(session_file_path,"%s",strstr(tmp1,"=")+1);
-      else
-	sprintf(session_file_path,"%s",strstr(_tmp->value,"=")+1);
-      sessId=zStrdup(session_file_path);
-    }else{
-      maps* t=getMaps(m,"senv");
-      map*p=t->content;
-      while(p!=NULL){
-	if(strstr(p->name,"ID")!=NULL){
-	  sessId=zStrdup(p->value);
-	  break;
-	}
-	p=p->next;
-      }
-    }
-    char session_file_path[1024];
-    map *tmpPath=getMapFromMaps(m,"main","sessPath");
-    if(tmpPath==NULL)
-      tmpPath=getMapFromMaps(m,"main","tmpPath");
-    sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,sessId);
-    FILE* teste=fopen(session_file_path,"w");
-    if(teste==NULL){
-      char tmpMsg[1024];
-      sprintf(tmpMsg,_("Unable to create the file \"%s\" for storing the session maps."),session_file_path);
-      errorException(m,tmpMsg,"InternalError",NULL);
-      return;
-    }
-    else{
-      fclose(teste);
-      dumpMapsToFile(tmpSess,session_file_path,1);
-    }
-  }
+  printSessionHeaders(m);
   if(res==SERVICE_FAILED){
     char* tmp0=produceErrorMessage(m);
Index: trunk/zoo-project/zoo-kernel/response_print.h
===================================================================
--- trunk/zoo-project/zoo-kernel/response_print.h	(revision 965)
+++ trunk/zoo-project/zoo-kernel/response_print.h	(revision 966)
@@ -197,4 +197,5 @@
 
   void printHeaders(maps*);
+  void printSessionHeaders(maps*);
 
   int zooXmlSearchForNs(const char*);
Index: trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 965)
+++ trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 966)
@@ -1950,5 +1950,5 @@
 	"/","/api","/conformance","/processes"
       };
-      map* tmpUrl=getMapFromMaps(m,"main","serverAddress");
+      map* tmpUrl=getMapFromMaps(m,"openapi","rootUrl");
       for(int kk=0;kk<4;kk++){
 	maps* tmpMaps=getMaps(m,urls[kk]);
