Fix cases when clientId is invalid or queryParam is null or empty