They were negotiating with Warner Music over the rights to publish and annotate the company’s lyrics on their site, having already made similar deals with all the other key publishers, and thereby dodging a serious legal threat to the site’s business model.

That’s when one of the site’s users uploaded a controversial document to the platform: the 137-page manifesto left behind by the woman-hating Santa Barbara gunman Elliot Rodger, who had killed six people and wounded 13 others just hours before.

Then, availing himself of the site’s annotation tool, another user highlighted various bits of text and added his own commentary to offer another perspective on Rodger’s story.

But there was a problem. Well, two, actually. The first: The annotations did nothing to illuminate the text in question. Far from offering the sort of insightful, well-informed take that has brought the site as many as 35 million monthly uniques and won kudos from everyone from Nas to Junot Díaz, they were more akin to the sort of juvenile remark one might find buried in the comments thread on a low-budget news aggregator: cruel, idiotic, shockingly insensitive, and misogynistic.

The second problem was the person who wrote the annotations: Moghadam.

But in the years since launching Rap Genius, they had become better known for their antics and unflattering press, and none more so than Moghadam.

There's the story about how Ben Horowitz, a Rap Genius investor, hosted the cofounders for dinner and invited the rapper Nas and Facebook founder Mark Zuckerberg to join them. After a few drinks, Moghadam took out his phone to snap a picture of Nas and Zuckerberg together. Zuckerberg asked him not to. Moghadam took the shot anyway and posted it on Instagram.

“I was drunk and I went paparazzi,” Moghadam said. “I didn’t even think it would be a thing.” It was. The photo ended up in news stories all over the internet, and Zuckerberg asked Moghadam to take it down. He did, and he wrote a letter of apology to the Facebook founder.

The next morning I went to breakfast at the hotel restaurant. The host sat me down at a table next to Moghadam's. He was eating with the same employee he'd introduced me to the night before.

I was not trying to eavesdrop, but I overheard Moghadam tell the Genius employee that Kanye West had once made a redesign of Genius in Photoshop and sent it to an investor. Moghadam said the investor had forwarded the redesign to Lehman, Genius's CEO, and that Lehman had rejected it. This had seriously pissed Kanye off, Moghadam told the employee.

I thought this was a funny story, one that would make for a great post on Business Insider. But I didn't want Moghadam to feel as if I’d ambushed him.

So a few days later I sent him an email. "I really think the story is great," I wrote, "and want to write it up. But I didn't want to do that without talking to you first and giving you a heads-up. Want to talk to me about it?"

His reply was odd. He said he'd made the whole thing up, that he'd been lying to the German employee to impress him.

“I am a big-time faker to these kids,” he wrote. “I tell them stuff to build RG mystique because that keeps them impassioned — but I am full of lies.”

It seemed like an amateur and ham-handed attempt at press management, but it was pretty harmless. And it was more or less in keeping with the irreverent, freewheeling style the company had cultivated from the start.

Moghadam later attributed some of his behavior to the effects of the then unknown brain tumor, but the first indication that Moghadam’s unruly approach could do damage came late last year, after his surgery had been deemed a success.

Lehman says he didn't "reject Kanye's design."

“Kanye sent us an astonishing and progressive concept. We spent a ton of time thinking about it and tried our best to keep up the collaboration, but Kanye was too busy and we haven't gotten together on it yet.”

The Investor

While visiting his parents in Detroit for Thanksgiving, Zechory wound up attending a Detroit Lions game with a friend. Zechory's friend spotted the teenage son of Dan Gilbert, the billionaire owner of Quicken Loans and the Cleveland Cavaliers.

A few days before, someone on the tech-news-aggregation site Hacker News had written a comment highlighting Moghadam’s Facebook post asking for links. Commenters responded with angry calls for Google to investigate the way Rap Genius got stories to rank so high in Google searches.

Cutts didn't like what he found. In addition to the Facebook post, Moghadam had been emailing bloggers, promising to tweet about their blogs from the Rap Genius Twitter account if they put links to Rap Genius on their pages.

As the crisis unfolded, Gilbert reached out to say the offer was on hold while he waited to see how everything played out. Then the billionaire emailed his pals at Andreessen Horowitz and asked if the issue was going to sink the company. Marc Andreessen wrote him back and said: “These things are never fun in the moment but typically turn out to be blessings in disguise, assuming the team manages the recovery properly.” Then he gave the examples of crises well-met by eBay, Twitter, Intel, AirBNB

At the beginning of February, Gilbert sent the guys a final term sheet. He offered to lead a $40 million investment, valuing the company at several hundred million dollars. Zechory says the actual valuation is one secret he'd like to keep. With a laugh, he says it's "under a billion." (The rumor is $400 million.)

They kept the deal secret for months to coordinate its announcement with the news of the new Genius.com domain name.

Before long, Rap Genius had put the Google crisis behind it, and it looked like smooth sailing for the site.

About Those Haircuts

When I met with the trio in April, Zechory said lots of startup founders with sterling reputations “use swear words and smoke weed.” The difference is, “We try not to deny that we’re just humans.”

Zechory and Moghadam both told me that for the company’s first few years they acted the way they did in part to get attention for the site. The Google ordeal — and almost losing out on Gilbert’s $40 million — taught them they needed to tone it down.

While they both seemed to regret the TechCrunch interview — Moghadam said he won’t be wearing sunglasses onstage anymore — Lehman did not.

On Memorial Day weekend, Moghadam called his cofounders to let them know he’d heard from a writer at Gawker who was doing a post on his annotations. A few of his notes praised particular passages as “beautifully written.” Another noted that a childhood friend of Rodger’s would later grow up and “turn into a spoiled hottie.” Finally, an annotation about Rodger’s sister read, “MY GUESS: His sister is smokin hot.”

The Genius team had been through crises before. At first, Zechory and Lehman suggested ways to improve the annotations, first by replacing them with more thoughtful insights and then by rallying the community as a whole to contribute smart commentary that might demonstrate what made the platform great.

Then they decided the company had suffered enough self-inflicted wounds. After discussing the situation with Ben Horowitz and Dan Gilbert, they made a decision: Moghadam was out.

“Mahbod is my friend,” Lehman wrote on the site. “He's a brilliant, creative, complicated person with a ton of love in his heart. Without Mahbod, Rap Genius would not exist ... But I cannot let him compromise the Rap Genius mission — a mission that remains almost as delicate and inchoate as it was when we three founders decided to devote our lives to it almost 5 years ago.”

“Firing your close, close friend and someone who built this thing with you from nothing is hard emotionally,” Zechory said. “This was the hardest decision we ever had to make. But he’d been given enough chances in the past that he knew where we stood, and we had to go through with it.” Stirring the pot is one thing, he added, but “saying something uncreative and mean and misogynistic and insensitive to a tragedy is very different.”

“There’s another level of badness to it,” Lehman pointed out, “which is that it’s the opposite of what we want the platform to be used for.”

As for Moghadam, a few weeks after leaving the company he seemed characteristically exuberant. In a Facebook chat, I asked what he’d been up to.

"Working on the rap genius book homie!"
"I am about 40 pages in, my dream is for james franco to play me in the movie"
"it is gonna be epic"
"it's all gonna be in there"
"it is a story of love, a story of invention"
"you will laugh, you will cry ... "
"you're gonna love it"
"it's really funny!"

I wondered if he felt regretful.

"ah obviously I am deeply ashamed, but now is a time of reflection for me — I am so proud of what we've built and I'm excited to watch it grow!"
"now that I'm looking at it from the outside, it seems even more marvelous to me"
"and I'm really excited to chronicle the formation of it in the book."