made the api more flexible in terms of types and locators