parses files returning json object that represents the files structure