Optionally write json responses to files in a given path