Add url encoding to query