move to core & api structure