initial fileapi code