Refactor result=ok type API calls check