fileAPI: fix several cases