*8148* refactor file api handlers