toJSON data and save to server