added edit purchase endpoint