Added an encode function for queries used in http requests.
bug fix: Query was broken.