add support for sensu API authentication
Whitespace and reorg conditional