[refactor] move some of API stuff to Core

Overall idea is: Core and Database contain base stuff and don't import
API. And API imports from Core and Database.
parent 1e78d061
Pipeline #5645 failed with stages