Total re-write of the API