Use CGI.escape rather than URI.escape

Its recommend to use CGI.escape instead of URI.escape.

https://github.com/ruby/ruby/commit/238b979f1789f95262a267d8df6239806f2859cc#diff-5aecce86ef66006d6771d4e81587be2cR504

Here is a Stack Overflow post about it as well.

http://stackoverflow.com/questions/2824126/whats-the-difference-between-uri-escape-and-cgi-escape#answer-13059657

Your API kept sending me errors about not being encoded.

After updating to this, I started getting better results.