Add support for Unifi controller v3. Return error type instead of exiting on error.