writes json to file (with slashes though :/