fix conditions and simplify logic on long api call methods