public static JSONObject addFriend(String key, String addFriend){
		try {
			
			int friend = Integer.parseInt(addFriend);
			int user = UserTools.keyValid(key);
			
			if(friend == user)
				return ErrorMsg.otherError("You are already friend with yourself, aren't you ?");
			
			FriendTools.addFriend(user,friend);
			return JSONtools.ok();
			
		} catch (NumberFormatException e) {
			return ErrorMsg.wrongParameter();	
			
		} catch (KeyInvalidException e) {
			return ErrorMsg.invalidKey();
			
		}  catch (SQLException e) {
		
			if(e.getErrorCode() == 1062)//Duplicate entry Key
				return ErrorMsg.otherError("You are already friends :)");
			
			if(e.getErrorCode() == 1452)//Key doesn't match FK Constraint
				return ErrorMsg.userDoesntExist(addFriend);
			
			return ErrorMsg.bdError();
			
		} catch (userDoesntExistException e) {
			return ErrorMsg.bdError();
		}
	}