more stuff with file API, albeit buggy