Index: /user/src/services/users/Register.java
===================================================================
--- /user/src/services/users/Register.java (revision 727)
+++ /user/src/services/users/Register.java (revision 757)
@@ -27,6 +27,4 @@
  * Servlet implementation class Register
  *
- * 
- * 
  * @author Giagkos Mytilinis
  *
@@ -35,6 +33,20 @@
 @WebServlet("/Register")
 public class Register extends HttpServlet {
+	
 	private static final long serialVersionUID = 1L;
 	private ServiceDescription description;
+	
+	public static String WEBSERVER_IP = "83.212.104.253";
+	
+	private static String twitterConsumerToken = "xJkcRYwkcyfi6H7cc25JNQ";
+	private static String twitterConsumerSecret = "dzo4wR2zBn1gbhFgxhhFVcZHVe8UKMS4VwL1FqI0Cgk";
+	
+	private static String fsqClientId = "PJB10MU45PJUL3VBHFCT4U33TNWY3C0S00TZ4SQE0QYHXWNM";
+	private static String fsqClientSecret = "YOCYLYFQ0M0PFUJIAEF5F25OTDYOEAFLU1GNMXRUVXQIPUG0";
+	private static String fsqCallback= "https://"+WEBSERVER_IP+"/user/fsqcallback";
+	
+	private static String fbAppID = "639597272729984";
+	private static String fbRedirectUri = "https://"+WEBSERVER_IP+"/user/fbcallback";
+	private static String fbAppSecret = "ad3863c9da1454434841e1bc870bcc1e";
 	
     /**
@@ -51,4 +63,36 @@
     }
 
+    public static String getTwitterConsumerToken(){
+    	return twitterConsumerToken;
+    }
+    
+    public static String getTwitterConsumerSecret(){
+    	return twitterConsumerSecret;
+    }
+    
+    public static String getFoursquareClientID(){
+    	return fsqClientId;
+    }
+    
+    public static String getFoursquareClientSecret(){
+    	return fsqClientSecret;
+    }
+    
+    public static String getFoursquareCallback(){
+    	return fsqCallback;
+    }
+    
+    public static String getFbAppID(){
+    	return fbAppID;
+    }
+    
+    public static String getFbAppSecret(){
+    	return fbAppSecret;
+    }
+    
+    public static String getFbRedirectURI(){
+    	return fbRedirectUri;
+    }
+    
 	/**
 	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
@@ -79,5 +123,5 @@
 				Twitter twitter = new TwitterFactory(cb.build()).getInstance();
 				
-				twitter.setOAuthConsumer("xJkcRYwkcyfi6H7cc25JNQ", "dzo4wR2zBn1gbhFgxhhFVcZHVe8UKMS4VwL1FqI0Cgk");
+				twitter.setOAuthConsumer(twitterConsumerToken, twitterConsumerSecret);
 				
 				try {
@@ -101,10 +145,6 @@
 			}else if(socialNetwork.equals("foursquare")){
 				
-				String clientId = "PJB10MU45PJUL3VBHFCT4U33TNWY3C0S00TZ4SQE0QYHXWNM";
-				String clientSecret = "YOCYLYFQ0M0PFUJIAEF5F25OTDYOEAFLU1GNMXRUVXQIPUG0";
-				String callback= "https://83.212.104.253/user/fsqcallback";
-				
 				try{
-					FoursquareApi foursquareApi = new FoursquareApi(clientId,clientSecret,callback);
+					FoursquareApi foursquareApi = new FoursquareApi(fsqClientId,fsqClientSecret,fsqCallback);
 					response.sendRedirect(foursquareApi.getAuthenticationUrl());
 				}catch(Exception e){
@@ -113,6 +153,4 @@
 				
 			}else if(socialNetwork.equals("facebook")){
-					 String appID = "639597272729984";
-					 String redirect_uri = "https://83.212.104.253/user/fbcallback";
 					 String code = request.getParameter("code");
 					 
@@ -125,6 +163,6 @@
 						 //permissions+=",read_mailbox";
 						 
-						 response.sendRedirect("https://www.facebook.com/dialog/oauth?client_id="+appID+"&redirect_uri="+
-								 OAuth.percentEncode(redirect_uri)+"&state="+state+"&scope="+permissions);
+						 response.sendRedirect("https://www.facebook.com/dialog/oauth?client_id="+fbAppID+"&redirect_uri="+
+								 OAuth.percentEncode(fbRedirectUri)+"&state="+state+"&scope="+permissions);
 					 }
 					
Index: /user/src/services/users/UserInfo.java
===================================================================
--- /user/src/services/users/UserInfo.java (revision 727)
+++ /user/src/services/users/UserInfo.java (revision 757)
@@ -110,6 +110,6 @@
 					ConfigurationBuilder userConfBuilder = new ConfigurationBuilder();
 					userConfBuilder.setDebugEnabled(true)
-					  .setOAuthConsumerKey("xJkcRYwkcyfi6H7cc25JNQ")
-					  .setOAuthConsumerSecret("dzo4wR2zBn1gbhFgxhhFVcZHVe8UKMS4VwL1FqI0Cgk")
+					  .setOAuthConsumerKey(Register.getTwitterConsumerToken())
+					  .setOAuthConsumerSecret(Register.getTwitterConsumerSecret())
 					  .setOAuthAccessToken(results.get(i).get("sn_token"))
 					  .setOAuthAccessTokenSecret(results.get(i).get("sn_token_secret"))
@@ -174,9 +174,6 @@
 					jsonToSend+="{\"network\":\"foursquare\",\"friends\":[";
 					
-					String clientId = "PJB10MU45PJUL3VBHFCT4U33TNWY3C0S00TZ4SQE0QYHXWNM";
-					String clientSecret = "YOCYLYFQ0M0PFUJIAEF5F25OTDYOEAFLU1GNMXRUVXQIPUG0";
-					String callback= "https://83.212.104.253/user/fsqcallback";
-					
-			        FoursquareApi foursquareApi = new FoursquareApi(clientId,clientSecret,callback);
+			        FoursquareApi foursquareApi = new FoursquareApi(Register.getFoursquareClientID(),
+			        		Register.getFoursquareClientSecret(),Register.getFoursquareCallback());
 			        foursquareApi.setoAuthToken(results.get(i).get("sn_token"));
 			        
Index: /user/src/supportingClasses/TwitterCallback.java
===================================================================
--- /user/src/supportingClasses/TwitterCallback.java (revision 266)
+++ /user/src/supportingClasses/TwitterCallback.java (revision 757)
@@ -16,4 +16,5 @@
 
 
+import services.users.Register;
 import session.SessionManagementIM;
 import twitter4j.Twitter;
@@ -32,7 +33,8 @@
  * @author Giagkos Mytilinis
  */
-public class TwitterCallback extends HttpServlet {
+public class TwitterCallback extends RunningWebService {
+	
 	private static final long serialVersionUID = 1L;
-       
+
     /**
      * @see HttpServlet#HttpServlet()
@@ -40,4 +42,6 @@
     public TwitterCallback() {
         super();
+        serviceName = "Twitter Callback: ";
+        DEBUG = true;
     }
 
@@ -58,5 +62,5 @@
 		HttpSession session = request.getSession();
 				
-		twitter.setOAuthConsumer("xJkcRYwkcyfi6H7cc25JNQ", "dzo4wR2zBn1gbhFgxhhFVcZHVe8UKMS4VwL1FqI0Cgk");
+		twitter.setOAuthConsumer(Register.getTwitterConsumerToken(), Register.getTwitterConsumerSecret());
 		try {
 			AccessToken accessToken = twitter.getOAuthAccessToken(new RequestToken((String) session.getAttribute("token"), 
@@ -69,6 +73,6 @@
 			ConfigurationBuilder userConfBuilder = new ConfigurationBuilder();
 			userConfBuilder.setDebugEnabled(true)
-			  .setOAuthConsumerKey("xJkcRYwkcyfi6H7cc25JNQ")
-			  .setOAuthConsumerSecret("dzo4wR2zBn1gbhFgxhhFVcZHVe8UKMS4VwL1FqI0Cgk")
+			  .setOAuthConsumerKey(Register.getTwitterConsumerToken())
+			  .setOAuthConsumerSecret(Register.getTwitterConsumerSecret())
 			  .setOAuthAccessToken(accessToken.getToken())
 			  .setOAuthAccessTokenSecret(accessToken.getTokenSecret())
@@ -78,4 +82,8 @@
 			Twitter userTwitter = tf.getInstance ();
 			
+			/*
+			 * Search in the DB according to social network and userID. This search can return
+			 * either one or none results.
+			 */
 			
 			SNDetails socialNetworkInfo = new SNDetails();
@@ -84,54 +92,64 @@
 					
 			List<HashMap<String, String>> results = socialNetworkInfo.read();
-			System.out.println(results);
 			
-			String token = null;
+			String token = null; 
 			
 			PersistentHashMapClient hashClient = new PersistentHashMapClient();
 			
 			if(results.size()==0){
-				
+				/*
+				 *  If there are no results, we can either add a new Modissense account
+				 *  or connect a social network account to an existing one.
+				 */
 				socialNetworkInfo.setSnToken(accessToken.getToken());
 				socialNetworkInfo.setSnTokenSecret(accessToken.getTokenSecret());
 				
-				System.out.println((String)session.getAttribute("uidtoken"));
 				if(!((String)session.getAttribute("uidtoken")).equals("null")){
-			
-					System.out.println("step2");
+						
+					if(DEBUG)System.out.println(serviceName+"Connect Twitter account to existing Modissense user.");
+					
 					token = (String) session.getAttribute("uidtoken");
-					System.out.println(token);
+					if(DEBUG)System.out.println(serviceName+"user token = "+token);
 					
 					int usid = hashClient.getUserId(token);
-					
-					System.out.println();
-					
+						
 					socialNetworkInfo.setUserId(usid);
 					if(socialNetworkInfo.create()){
-						System.out.println("sn_list entry created successfully.");
+						System.out.println(serviceName+"sn_list entry created successfully.");
 					}
 					else
-						System.out.println("sn_list entry failed");
+						System.out.println(serviceName+"sn_list entry failed");
 				}else{
-					System.out.println("ftiaxnw neo user");
+					if(DEBUG)System.out.println(serviceName+"Create new Modissense user.");
+					
 					User newUser = new User();
 					newUser.setUsername(userTwitter.getScreenName());
 					if(newUser.create()){
-						System.out.println("user entry created successfully.");
+						if(DEBUG)System.out.println(serviceName+"user entry created successfully.");
 						User theSameUser = new User(userTwitter.getScreenName());
 						socialNetworkInfo.setUserId(theSameUser.getId());
 						
 						token = Utils.randomStringGenerator(32); 
+						if(DEBUG)System.out.println(serviceName+"New user acquired token = "+token);
 						hashClient.add(token, theSameUser.getId());
 						
 						if(socialNetworkInfo.create()){
-							System.out.println("sn_list entry created successfully.");
+							System.out.println(serviceName+"sn_list entry created successfully.");
 						}
 						else
-							System.out.println("sn_list entry failed");
+							System.out.println(serviceName+"sn_list entry failed");
 					}
 					else
-						System.out.println("user entry failed.");
+						System.out.println(serviceName+"user entry failed.");
 				}
 			} else{
+				/*
+				 * In the DB there is a twitter account with the specific user id. Update twitter access token
+				 * as it may have expired and check if there is a valid session token for this user.
+				 */
+				HashMap<String, String> tokensToUpdate = new HashMap<String, String>();
+				tokensToUpdate.put("sn_token", "'"+accessToken.getToken()+"'");
+				tokensToUpdate.put("sn_token_secret", "'"+accessToken.getTokenSecret()+"'");
+				socialNetworkInfo.update(tokensToUpdate);
 				
 				if(hashClient.getSession(socialNetworkInfo.getUserId()).equals("null")){
@@ -139,8 +157,8 @@
 					token = Utils.randomStringGenerator(32); 
 					hashClient.add(token, socialNetworkInfo.getUserId());
-					System.out.println("mpike me token: "+token);
+					if(DEBUG)System.out.println(serviceName+"Existing user got new token. Token = "+token);
 				}else{
 					token=hashClient.getSession(socialNetworkInfo.getUserId());
-					System.out.println("to session mou: "+token);
+					if(DEBUG)System.out.println(serviceName+"Existing user logged in. Valid token= "+token);
 				}
 			}
Index: /user/src/supportingClasses/FbCallback.java
===================================================================
--- /user/src/supportingClasses/FbCallback.java (revision 727)
+++ /user/src/supportingClasses/FbCallback.java (revision 757)
@@ -21,4 +21,5 @@
 import datastore.client.PersistentHashMapClient;
 
+import services.users.Register;
 import session.SessionManagementIM;
 
@@ -33,5 +34,5 @@
  */
 
-public class FbCallback extends HttpServlet {
+public class FbCallback extends RunningWebService {
 	
 	private static final long serialVersionUID = 1L;
@@ -42,4 +43,6 @@
     public FbCallback() {
         super();
+        serviceName = "Facebook Callback: ";
+        DEBUG = true;
     }
 
@@ -51,35 +54,26 @@
 		HttpSession session = request.getSession();
 		
-		String appID = "639597272729984";
-		String appSecret = "ad3863c9da1454434841e1bc870bcc1e";
-		String redirect_uri = "https://83.212.104.253/user/fbcallback";
 		String code = request.getParameter("code");
 		
-		//gia na vroume th malakia .....
-		
-		
-		Enumeration<String> enm = request.getParameterNames();
-		while(enm.hasMoreElements()){
-			String pname = enm.nextElement();
-			System.out.print("param: "+pname);
-			if(request.getParameter(pname)!=null)
-				System.out.println("value: "+request.getParameter(pname));
+		if(DEBUG){
+			System.out.println(serviceName+"-----Parameters-----");
+			Enumeration<String> enm = request.getParameterNames();
+			while(enm.hasMoreElements()){
+				String pname = enm.nextElement();
+				System.out.print(serviceName+"param: "+pname);
+				if(request.getParameter(pname)!=null)
+					System.out.println(serviceName+"value: "+request.getParameter(pname));
+			}
 		}
 		
-		
-		
-		
-		//---------------------------------
-		
-	
 		if(((String) session.getAttribute("state")).equals(request.getParameter("state"))){
 			 if(request.getParameter("error")!=null){
-				 System.out.println("The user denied to authorize your app");
-				 System.out.println(request.getParameter("error_reason"));
-				 System.out.println(request.getParameter("error"));
-				 System.out.println(request.getParameter("error_description"));
+				 System.out.println(serviceName+"The user denied to authorize your app");
+				 System.out.println(serviceName+request.getParameter("error_reason"));
+				 System.out.println(serviceName+request.getParameter("error"));
+				 System.out.println(serviceName+request.getParameter("error_description"));
 			 }else{
-				 URL url = new URL("https://graph.facebook.com/oauth/access_token?client_id="+appID+"&" +
-							"redirect_uri="+OAuth.percentEncode(redirect_uri)+"&client_secret="+appSecret +
+				 URL url = new URL("https://graph.facebook.com/oauth/access_token?client_id="+Register.getFbAppID()+"&" +
+							"redirect_uri="+OAuth.percentEncode(Register.getFbRedirectURI())+"&client_secret="+Register.getFbAppSecret() +
 							"&code="+code);
 				 HttpsURLConnection conn =(HttpsURLConnection) url.openConnection();conn.setRequestMethod("GET");
@@ -98,5 +92,5 @@
 			     String accessToken = answerParts[1];
 			     
-			     System.out.println("fb access token = "+accessToken);
+			     if(DEBUG)System.out.println(serviceName+"fb access token = "+accessToken);
 			     url = new URL("https://graph.facebook.com/me?access_token="+accessToken);
 				 conn =(HttpsURLConnection) url.openConnection();conn.setRequestMethod("GET");
@@ -116,4 +110,9 @@
 			     String userId = (String) userObj.get("id");
 			     String username = (String) userObj.get("username");
+			     
+			     /*
+				  * Search in the DB according to social network and userID. This search can return
+				  * either one or none results.
+				  */
 			     
 			     SNDetails socialNetworkInfo = new SNDetails();
@@ -127,13 +126,17 @@
 				 	
 				 if(results.size()==0){
+					 	/*
+	    				 *  If there are no results, we can either add a new Modissense account
+	    				 *  or connect a social network account to an existing one.
+	    				 */
 						
 						socialNetworkInfo.setSnToken(accessToken);
 						
-						System.out.println((String)session.getAttribute("uidtoken"));
 						if(!((String)session.getAttribute("uidtoken")).equals("null")){
 					
-							System.out.println("step2");
+							if(DEBUG)System.out.println(serviceName+"Connect Facebook account to existing Modissense user.");
+							
 							token = (String) session.getAttribute("uidtoken");
-							System.out.println(token);
+							if(DEBUG)System.out.println(serviceName+"user token = "+token);
 							
 							int usid = hashClient.getUserId(token);
@@ -141,40 +144,49 @@
 							socialNetworkInfo.setUserId(usid);
 							if(socialNetworkInfo.create()){
-								System.out.println("sn_list entry created successfully.");
+								System.out.println(serviceName+"sn_list entry created successfully.");
 							}
 							else
-								System.out.println("sn_list entry failed");
+								System.out.println(serviceName+"sn_list entry failed");
 						}else{
-							System.out.println("ftiaxnw neo user");
+							if(DEBUG)System.out.println(serviceName+"Create new Modissense user.");
+							
 							User newUser = new User();
 							newUser.setUsername(username);
 							if(newUser.create()){
-								System.out.println("user entry created successfully.");
+								if(DEBUG)System.out.println(serviceName+"user entry created successfully.");
 								User theSameUser = new User(username);
 								socialNetworkInfo.setUserId(theSameUser.getId());			
 								
 								token = Utils.randomStringGenerator(32); 
-
+								if(DEBUG)System.out.println(serviceName+"New user acquired token = "+token);
 								hashClient.add(token, theSameUser.getId());
 									
 								if(socialNetworkInfo.create()){
-									System.out.println("sn_list entry created successfully.");
+									System.out.println(serviceName+"sn_list entry created successfully.");
 								}
 								else
-									System.out.println("sn_list entry failed");
+									System.out.println(serviceName+"sn_list entry failed");
 							}
 							else
-								System.out.println("user entry failed.");
+								System.out.println(serviceName+"user entry failed.");
 						}
 					} else{
-						//TODO: na mpei elegxos timhs
-						socialNetworkInfo.update(accessToken);
-					
+						/*
+	    				 * In the DB there is a twitter account with the specific user id. Update twitter access token
+	    				 * as it may have expired and check if there is a valid session token for this user.
+	    				 */
+						
+						HashMap<String, String> tokensToUpdate = new HashMap<String, String>();
+						tokensToUpdate.put("sn_token", "'"+accessToken+"'");
+						socialNetworkInfo.update(tokensToUpdate);
+						
 						if(hashClient.getSession(socialNetworkInfo.getUserId()).equals("null")){
 							
 							token = Utils.randomStringGenerator(32); 
 							hashClient.add(token, socialNetworkInfo.getUserId());
+							if(DEBUG)System.out.println(serviceName+"Existing user got new token. Token = "+token);
 						}else{
 							token=hashClient.getSession(socialNetworkInfo.getUserId());
+							if(DEBUG)System.out.println(serviceName+"Existing user logged in. Valid token= "+token);
 						}
 					}
Index: /user/src/supportingClasses/FoursquareCallback.java
===================================================================
--- /user/src/supportingClasses/FoursquareCallback.java (revision 727)
+++ /user/src/supportingClasses/FoursquareCallback.java (revision 757)
@@ -14,4 +14,5 @@
 import datastore.client.PersistentHashMapClient;
 
+import services.users.Register;
 import session.SessionManagementIM;
 
@@ -30,5 +31,5 @@
  */
 
-public class FoursquareCallback extends HttpServlet {
+public class FoursquareCallback extends RunningWebService {
 	
 private static final long serialVersionUID = 1L;
@@ -39,4 +40,6 @@
     public FoursquareCallback() {
         super();
+        serviceName = "Foursquare Callback: ";
+        DEBUG = true;
     }
 
@@ -46,12 +49,9 @@
 	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
 		
-		String clientId = "PJB10MU45PJUL3VBHFCT4U33TNWY3C0S00TZ4SQE0QYHXWNM";
-		String clientSecret = "YOCYLYFQ0M0PFUJIAEF5F25OTDYOEAFLU1GNMXRUVXQIPUG0";
-		String callback= "https://83.212.104.253/user/fsqcallback";
-		
-        FoursquareApi foursquareApi = new FoursquareApi(clientId,clientSecret,callback);
+        FoursquareApi foursquareApi = new FoursquareApi(Register.getFoursquareClientID()
+        		,Register.getFoursquareClientSecret(),Register.getFoursquareCallback());
 
         String code=request.getParameter("code");
-
+        
         HttpSession session = request.getSession();
         
@@ -64,5 +64,10 @@
               if (result.getMeta().getCode() == 200) {
                   CompleteUser fUser = result.getResult();
-                  System.out.println(fUser.getId());
+                  if(DEBUG)System.out.println(serviceName+"foursquare user "+fUser.getId());
+                  
+                /*
+      			 * Search in the DB according to social network and userID. This search can return
+      			 * either one or none results.
+      			 */
 
                   SNDetails socialNetworkInfo = new SNDetails();
@@ -78,12 +83,17 @@
     			if(results.size()==0){
     				
+    				/*
+    				 *  If there are no results, we can either add a new Modissense account
+    				 *  or connect a social network account to an existing one.
+    				 */
+    				
     				socialNetworkInfo.setSnToken(accessToken);
     				
-    				System.out.println((String)session.getAttribute("uidtoken"));
     				if(!((String)session.getAttribute("uidtoken")).equals("null")){
-    			
-    					System.out.println("step2");
+    					
+    					if(DEBUG)System.out.println(serviceName+"Connect Foursquare account to existing Modissense user.");
+    					
     					token = (String) session.getAttribute("uidtoken");
-    					System.out.println(token);
+    					if(DEBUG)System.out.println(serviceName+"user token = "+token);
     					
     					int usid = hashClient.getUserId(token);
@@ -91,37 +101,49 @@
     					socialNetworkInfo.setUserId(usid);
     					if(socialNetworkInfo.create()){
-    						System.out.println("sn_list entry created successfully.");
+    						System.out.println(serviceName+"sn_list entry created successfully.");
     					}
     					else
-    						System.out.println("sn_list entry failed");
+    						System.out.println(serviceName+"sn_list entry failed");
     				}else{
-    					System.out.println("ftiaxnw neo user");
+    					if(DEBUG)System.out.println(serviceName+"Create new Modissense user.");
+    					
     					User newUser = new User();
     					newUser.setUsername(fUser.getFirstName()+fUser.getLastName());
     					if(newUser.create()){
-    						System.out.println("user entry created successfully.");
+    						if(DEBUG)System.out.println(serviceName+"user entry created successfully.");
+    					
     						User theSameUser = new User(fUser.getFirstName()+fUser.getLastName());
     						socialNetworkInfo.setUserId(theSameUser.getId());
     						
     						token = Utils.randomStringGenerator(32); 
+    						if(DEBUG)System.out.println(serviceName+"New user acquired token = "+token);
     						hashClient.add(token, theSameUser.getId());
     						
     						if(socialNetworkInfo.create()){
-    							System.out.println("sn_list entry created successfully.");
+    							System.out.println(serviceName+"sn_list entry created successfully.");
     						}
     						else
-    							System.out.println("sn_list entry failed");
+    							System.out.println(serviceName+"sn_list entry failed");
     					}
     					else
-    						System.out.println("user entry failed.");
+    						System.out.println(serviceName+"user entry failed.");
     				}
     			} else{
+    				/*
+    				 * In the DB there is a twitter account with the specific user id. Update twitter access token
+    				 * as it may have expired and check if there is a valid session token for this user.
+    				 */
+    				
+    				HashMap<String, String> tokensToUpdate = new HashMap<String, String>();
+					tokensToUpdate.put("sn_token", "'"+accessToken+"'");
+					socialNetworkInfo.update(tokensToUpdate);
     				
     				if(hashClient.getSession(socialNetworkInfo.getUserId()).equals("null")){
-						
     					token = Utils.randomStringGenerator(32); 
     					hashClient.add(token, socialNetworkInfo.getUserId());
+    					if(DEBUG)System.out.println(serviceName+"Existing user got new token. Token = "+token);
 					}else{
 						token=hashClient.getSession(socialNetworkInfo.getUserId());
+						if(DEBUG)System.out.println(serviceName+"Existing user logged in. Valid token= "+token);
 					}
     			}
@@ -131,8 +153,8 @@
               }
               else {
-                  System.out.println("Error occured: ");
-                  System.out.println("  code: " + result.getMeta().getCode());
-                  System.out.println("  type: " + result.getMeta().getErrorType());
-                  System.out.println("  detail: " + result.getMeta().getErrorDetail());
+                  System.out.println(serviceName+"Error occured: ");
+                  System.out.println(serviceName+"  code: " + result.getMeta().getCode());
+                  System.out.println(serviceName+"  type: " + result.getMeta().getErrorType());
+                  System.out.println(serviceName+"  detail: " + result.getMeta().getErrorDetail());
               }
               
Index: /user/src/entites/SNDetails.java
===================================================================
--- /user/src/entites/SNDetails.java (revision 696)
+++ /user/src/entites/SNDetails.java (revision 757)
@@ -121,7 +121,7 @@
 	 */
 	//TODO:prepei na proste8oun ki alla.gia thn wra einai mono update token
-	public boolean update(String token){
-		HashMap<String, String> id = new HashMap<String, String>();
-		id.put("sn_token", "'"+token+"'");
+	public boolean update(HashMap<String, String> id){
+		//HashMap<String, String> id = new HashMap<String, String>();
+		//id.put("sn_token", "'"+token+"'");
 		return this.update(id,this.serialize());
 	}
