added an argument for dem resolution
throw exceptions when users query for something that doesn't exist
removed unnecessary test