add tests and docs
refactor methods in json.ex and recorder.ex