New api

In progress (not yet done so DO NOT MERGE)