Data discrepancy between corehome and api

I was trying to segment data by returning visits and direct entry in the Piwik api by using the method method=VisitsSummary.get and the segments segment=visitorType==returning;referrerType==direct. I got an answer that did not seem logical so I tried to just segment the data by =visitorType==returning and checked the data in the corehome page and there was a huge difference in the number of visits. Could anyone tell me what could cause this or if I am doing something wrong?