moved around some functions in core_api
some more changes to tests