2005 sportman 400 check engine HOT and shooting antifreeze

So i just bought a 2005 polaris sportman 400 and took it out on a trial for the first time. Its was doing really good for a long time. Right about 40 miles into my ride the check engine HOT light came on and i looked down, and there was anti freeze shooting out of the little hole on the cap of the resivior tank. When i turned the atv off i didnt seem to here the fan power down, almost as if it might not have been running. What could this be?