searches and returns for a single object given an attribute, and all objects given an attribute