Joel Clark was barely making ends meet: he had borrowed $250,000 to keep his pancake mix company alive, started several side hustles for extra cash, spoke with a bankruptcy lawyer about his options and briefly left his post as CEO. But a new recipe, and an appearance on Shark Tank, transformed the struggling startup into a booming business.

"I think the fact that we made it through those years is unbelievable," says Clark, 43, who still runs the Park City, Utah-based company Kodiak Cakes. "That's one of the hardest things I've lived through."

If tough starts make for better finishes, then Kodiak Cakes is a sterling example. Clark has helped transform Kodiak Cakes into the fourth-largest pancake mix brand and the largest whole grain pancake mix company in the U.S. The company booked more than $54 million in revenue last year.  Clark attributes Kodiak Cake's turnaround to a new product-- Power Cakes, a mix that includes protein powder--and the publicity from appearing on Shark Tank, even though he left empty-handed.  Added protein is part of Kodiak Cakes' added appeal--most mixes have between 8 and 14 grams of protein.

Clark stuck with Kodiak Cakes because of family ties. His mother Penny was the creator of the original pancake recipe and in 1982 went door-to-door selling the homemade mixes off the back of Clark's red wagon. Penny didn't continue her paper bag business after that year, but Clark's brother Jon used her recipe when he launched Kodiak Cakes in 1995. 

Brother Jon sold the mixes to gift shops in ski towns like Park City and ran the business for two years as a side hustle. But he struggled to balance a full-time job and Kodiak Cakes, so in 1997 he handed operations over to Clark, who hardly seemed  prepared, given that he was then 23 and a student at the University of Utah. 

The next seven years were a juggling act for Clark: he ran the business at night so he could complete his degree in economics and earn an MBA. He even held other jobs to maintain a steady income. Then, in 2004, he quit his full-time gig and made Kodiak Cake his main focus. His father Richard helped out and the pair lifted the company from about $150,000 in revenue in 2004 to $800,000 in 2007.

While the growth was nice, there wasn't enough to make the business sustainable. It was now Clark's turn to struggle to earn enough to support his family.  To subsidize his income he started a retail cookie business, flipped cars and homes--and even met with a bankruptcy lawyer to explore his options. Clark regretted not taking funding during the early stages of his leadership, but he recalls a lack of interested investors because Kodiak Cakes was so small at the time. Nor did he want other parties making decisions about the company he cherished.

"That's a typical distraction for entrepreneurs," Clark says. "There is a benefit to having money earlier on, but there is a downside because you have somebody else sharing the decisions."

Clark was still facing money issues in 2007 when he quit Kodiak Cakes for a higher-paying job as CEO of a small home healthcare agency. Another company, which Clark declined to identify, licensed the pancake brand and took over operations. Clark soon felt the new company was spread too thin and subsequently made poor decisions for Kodiak Cakes, including raising prices. He exercised his right to cancel the contract within the first year and returned as CEO. The boss was back. 

"I had already spent 11 years on the business; I couldn't watch this," Clark says. "I jumped back into it-- I was going to see it through to the end whether it worked or whether it failed."

Still facing money issues,  Clark had to borrow a total of $250,000 from his father in two installments to cover bills and to finance an order from Target. However, his luck started to change in 2009, when Cameron Smith, 23 years old and a student at the University of Utah--like he was once-- joined the team.

"I'm the type of person who gets passionate about things and gets aggressive about stuff," says Smith, who is now 33 and the COO of Kodiak Cakes. "There are times I don't ask permission, I just do things, in a good way."

Business slowly started to improve and Smith, a fan of Shark Tank, cold emailed the producers in 2013. Clark had seen bits of the program, but had never watched a full episode until Kodiak Cakes was accepted as a contestant. Clark and Smith asked for $500,000 in exchange for 10 percent of the company, but couldn't agree on a deal with the sharks. Kevin O'Leary called the product a commodity, adding that he could duplicate it, while Mark Cuban praised their decision not to take a deal that would require handing over more equity. Walking out of the tank without a deal didn't matter--the appearance aired in 2014 and sales skyrocketed shortly after.

Kodiak Cakes' sales rose from $3.6 million in 2013 to $6.7 million the following year, getting an added boost from the launch of its Power Cakes. The sales jump gave the company the momentum to focus on innovation and new products, like its frozen waffles and muffin mixes.

"I rode it through and just barely, by the skin of our teeth, we got through it," Clark says. "Luckily we survived," Clark says.

Now Kodiak Cakes competes with multiple brands across the breakfast space. For pancakes, it's up against Aunt Jemima, Krusteaz and Birch Benders, while it battles Betty Crocker and Duncan Hines for its muffin mixes and minute muffin product. The company sells to retailers such as Whole Foods, Target and Costco.

While these struggles are not unique to Clark, he encourages other entrepreneurs in similar positions to set short-term goals that they can hit in six-month time periods. By using that method, he could envision his progress, measure it and stay on track. And when his optimism waned, he read letters and emails from customers who raved about the products.

"I kept that tiny fire of passion inside of me and kept thinking, I have to keep going and figure out how to make this work," Clark says. "Don't quit too early, you may not give yourself enough time to make it work."