add api for controlling persistence type