allow to define the api for a resource