added api method to save purchases