public SimpleUrlShortener(final String apiUrl, 
			final Map<String, String> apiCredentials) {
		String apiUrlFormatted = apiUrl;
		
		if (apiCredentials != null) {
			for (String credentialName : apiCredentials.keySet()) {
				String credential = apiCredentials.get(credentialName);
				if (credential == null) {
					continue;
				}
				apiUrlFormatted = apiUrlFormatted.replace("%%" + credentialName + "%%", credential);
			}
		}
		
		this.apiUrl = apiUrlFormatted;
		
		String testAuthentication = this.shortenUrl("http://dev.bukkit.org/server-mods/wikisearch");
		if (testAuthentication == null) {
			throw new IllegalArgumentException("invalid API credentials");
		}
	}