addAttributeWithName APIs

Closes #272