Change to curl

Changed from File_get_contents and fixed an error