added tests and improved logic for request-lived attributes and services