separated api and core to avoid circular namespaces