Revert "Removed urlencodes"

This reverts commit 9fc00d1abd14bb990ec3670eea65733446c58b56.
Revert "Fixed unit tests"

This reverts commit 89145e13fb9ce3b204601c4918b233cdf4f0938b.