Fixing bad IF in API