json helper will invoke to_json