Updating save function to save a json string as the array