Refactor to get rid of the filename requirement.
force json to true for now.