api: implement invalidation