edited extract JSON to be similar to readFile and just return the json