Adding basic error validation
Using generate_urls func instead of making my own strings