Required secret fix

Removed the requirement to provide "secret" in API responses if no secret is actually required (previously, an empty secret value was required).

Also cleaned up a couple of uses of TextUtils.isEmpty() combined with redundant null checks.