Add with_data parameter to to_json(); Update README of this interface