add json based save logic