Added code to edit purchases on the backend