2016 was a tumultuous year for many--from the June Brexit decision, to the surprise victory of Donald J. Trump in the U.S. presidential election--and New York startups have faced plenty of setbacks.

The market is slimmer than you might expect. Consider that New York City, which is home to heavyweights including Blue Apron and BuzzFeed, is just around 30 percent the size of San Francisco's tech ecosystem, according to the most recent PwC MoneyTree Report. Overall, in 2016, venture capital investment in the New York metro area declined by nearly $2 billion: Just $7.4 billion was invested in local startups, compared with $9.3 billion in 2015, according to PitchBook data. (It's worth pointing out that venture capital investment in the U.S. at large also declined this year, from $79.4 billion to $67.5 billion, the data showed.)

It was a year marked by shifting investor sentiment, startup founders say. "Going into 2016, there were a lot of questions around how easy it would be to find capital," recalls Brad Hargreaves, a co-founder of the online coding school General Assembly, and the founder and CEO of Common, a co-living company based in Manhattan. The prevailing sentiment was that capital would be difficult to come by. Still, he characterizes these concerns as largely "overblown."

To his point, a number of private companies in New York received sizeable investments last year. Common raised $16 million in Series B funding in June, while the HR services startup Justworks landed $33 million from investors including Thrive Capital and Bain Capital Ventures. Foursquare got $45 million to expand its reviews platform, despite seeing its co-founder and CEO, Dennis Crowley, step down last January. The key to winning capital, unlike in previous years, has been showing your investors a path to profitability.

"One of the big changes of 2016 is that investors got a lot more serious about unit economics," Hargreaves says. The entrepreneur also invests in startups through Maveron, a VC firm that has also invested in Common.

Smaller, Stronger

Adam Price, the founder and CEO at restaurant logistics provider Homer Logistics, actually sees fewer investments as a good thing for the New York ecosystem. The San Diego native launched his business in Manhattan in 2014. Today, Homer Logistics facilitates more than 50,000 New York City deliveries per month for restaurant clients including Five Guys and Dos Toros.

"New York is much friendlier [to startups] than San Francisco," Price says. "You're getting a lower valuation, but that allows you to become more attractive, and more suited to raise follow-on capital."

Not every industry felt the pinch. "Food was huge," says Charlie O'Donnell, founder of the Brooklyn, New York-based VC firm Brooklyn Bridge Ventures. Specifically, he nodded to the meal-kit delivery service Blue Apron as one example. Blue Apron saw more than $800 million in revenue last year, and is reportedly planning to go public this year--targeting a valuation of $3 billion. Meanwhile, the Brooklyn-based ice cream shop Ample Hills opened new locations in 2016, and Hungryroot, a vegetable-based meal delivery company based in Long Island City, won distribution through Whole Foods. (O'Donnell's firm has invested in Ample Hills and Hungryroot.)

The on-demand trend is helping spur the industry, says Darren Seifer, a food and beverage industry analyst with market research firm NPD Group. He sees 2016 as the culmination of a years-long trend, with consumers shirking traditional grocery stores for meal kits and other food delivery services. "Meal kits give customers the opportunity to have control over their products," Seifer says. "What we're seeing in 2016 is a culmination of movements that happened starting a decade ago." Millennials in particular see food as more of an experience, he adds, which makes New York offerings like Blue Apron, Plated and Ample Hills increasingly attractive.

Meanwhile, direct-to-consumer offerings also had a big year. Warby Parker, for example, has seen increased growth thanks to a series of retail stores, with co-founder Neil Blumenthal envisioning as many as 1,000 eyeglass shops by 2020. Just this week, the company announced plans to expand into 25 stores by the end of this year.

"Direct-to-consumer everything: That's New York's bread and butter," explains Homer Logistics' Price. "Companies that make everything from toothbrushes to mattresses and tampons [are huge]--I don't know if you'll see that stop."

Crosshairs and Crosswinds

Of course, some of New York's most glamorous startups closed up shop in 2016. In January, flash sales site Gilt Groupe--once valued at more than $1 billion--sold itself to Hudson's Bay Company for a meager $250 million, after learning the hard way that the daily deals model is difficult to scale. And in June, Gawker Media filed for bankruptcy protection after being hit with a lawsuit from pro-wrestler Hulk Hogan, which was secretly funded by Silicon Valley billionaire Peter Thiel. The company ultimately sold itself to Univision for just $135 million in August, and the website has since shut down.

It was a surprisingly good year for mergers and acquisitions, nonetheless. While total U.S. exit value remained the same in 2016, New York City exits reached $5.8 billion last year, up from $3 billion in 2015, according to PitchBook data. Notably, e-commerce startup Jet.com sold to Walmart for $3 billion in September, while Tapad, a Manhattan advertising tech firm, was acquired by Telenor Group for $360 million in February.

Looking Ahead

The future is bright--if not entirely clear--for New York startups. As many as 54 companies in the metro area are poised to go public in 2017, including Blue Apron, BuzzFeed and Sprinklr, according to CB Insights. Overall, New York accounts for some 15 percent of companies in the IPO pipeline, coming in just behind California, which has 207 companies likely to go public, the data showed. Brooklyn Bridge Ventures' O'Donnell goes so far as to anticipate a "windfall year for investors," and notes that VCs like him are increasingly willing to fund more creative business models.

"Early stage money is looking at more cutting edge stuff--less 'Warby for drapes' and more bots, AI, computer vision, autonomous vehicles, and VR," he says.

Still, many insiders say the victory of Donald J. Trump as president-elect has cast a shadow over the tech industry, especially where foreign labor is concerned. H-1B visas are already increasingly difficult to come by, and it's unclear to what extent Trump will continue to support the program for hiring skilled workers from overseas.

"It's an environment of uncertainty," says Common's Hargreaves. "We live in an industry where many companies are dependent on foreign workers, and I am concerned if that [hiring them] gets more difficult, that's going to put a major damper on innovation."

Correction: An earlier version of this story misstated the number of monthly deliveries Homer Logistics facilitates. The company processes 50,000 or more deliveries in New York City each month.