wip - more api -> data refactoring.

(not complete or even working).