Checking cURL return code and return a nice message if it fails