encode url, fetch data form correct url dont raise invalid url