API extended for collections. Added generic set method.