Refactored zabbix_api.py