Why not just make a get_url_content function like on the backend? This will read simpler.