updated API to not require encodeURIComponents