api demo for saving data in files