parses file returning json representing files structure