@Override
	public RegisterUserResponse registerUser(String username, String password) {
		ArrayList<Pair<String,String>> requestHeaders = new ArrayList<Pair<String,String>>();
		requestHeaders.add(new Pair<String,String>(CONTENT_TYPE_STR, APP_JSON_STR));
		UserRequest loginRequest = new UserRequest(username, password);
		ICommandResponse response = this.clientCommunicator.executeCommand(RequestType.POST, requestHeaders,"user/register", loginRequest, String.class);
		boolean successful = false;
		String cookie = "";
		String playerName = "";
		int playerID = -1;
		if(response.getResponseCode() == 200) {
			successful = true;
			cookie = response.getResponseHeaders().get("Set-cookie").get(0);
			int index = cookie.lastIndexOf(";Path=/");
			cookie = cookie.substring(0, index);
			String subCookie = cookie.replaceFirst("catan.user=", "");
			PlayerLoginCookie playerCookie = null;
			try {
				String cookieJSON = URLDecoder.decode(subCookie, this.cookieEncoding);
				playerCookie = (PlayerLoginCookie) this.cookieTranslator.translateFrom(cookieJSON, PlayerLoginCookie.class);
				playerID = playerCookie.getPlayerID();
				playerName = playerCookie.getName();
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}		
		return new RegisterUserResponse(successful, response.getResponseMessage(), playerName, cookie, playerID);
	}