separating out pieces into smaller functions
properly reporting 404 status
separating download_url into separate module