new way to get api instance
support resource name like "xxx/xxx"