Updating to detect SAPI... when running on cli, url generation should not be attempted