Added functionality for autodetecting the ZS and API version.