When true, invokeApi returns an offline error without calling the delegate.
bool simulateNetworkOffline = false;