Fix api.
Fix dealing with files.
Add core api features to root.
Refactor.