Fixed url to encode parameters to avoid a bad request error