private String buildEndpoint(String path, Map<String, String> parameters) {
        StringBuilder url = new StringBuilder();
        url.append(conf.getRestBaseURL() + path);
        if (parameters != null && parameters.size() > 0) {

            url.append("?");

            int i = 0;
            for (final String k : parameters.keySet()) {
                if (i > 0) {
                    url.append("&");
                }

                try {
                    url.append(URLEncoder.encode(k, "UTF-8"))
                       .append("=")
                       .append(URLEncoder.encode(parameters.get(k), "UTF-8"));
                } catch (UnsupportedEncodingException ignore) {
                }
                i++;
            }
        }
        return url.toString();
    }