Attach metadata when sending a Resource
Change handling of listening to 'resource' events