Add fallback if curl is not available
Renamed a few variables to prevent confusion