Added check for curl_init and curl_exec