add helper methods to json response.
update doc block.
use array_get on files.
work on hasFile and file.