Added support for agencies in API