split out core and api