Initial Core api support. Rewritten connection