Add file API, plus lot of stuff