added local option and fixed url escaping

locale is now an optional parameter to be passed.
fixed & character causing url to be invalid