You should use the JsonManipulator class and not do a full write, because that will destroy all formatting and whitespace that users might have.