LOS ANGELES - Writer-producers Kevin Biegel and Mike Royce decided in 2012 to create a TV workplace comedy about the military.

The odds were not in their favor.

Prime-time TV, once home to madcap military adventures such as Sgt. Bilko on "The Phil Silvers Show," "Hogan's Heroes" and "MASH," hadn't supported a military comedy in years.

"It's basically a workplace that is very important to America and has disappeared from television," said Royce.

That might have been in part because the U.S. had been at war for over a decade. Maybe the Army just wasn't funny anymore.

"It was kind of sacred ground," Biegel said. "People were like, 'Maybe you shouldn't do that.' But for us it was the opposite. We thought, 'Of course we should.'"

The duo made their sale on the first pitch, to Fox executives who embraced the concept heartily.

"Why isn't this show on the air right now?" Jonathan Davis, president of creative affairs at 20th Century Fox, remembers asking himself. "Why isn't anyone doing this yet?"

The resulting Friday night show, "Enlisted," premiered in January. The ensemble comedy follows a serviceman who is demoted after socking a superior officer and reassigned to lead a group of Army misfits.

Prior to "Enlisted," Biegel co-created "Cougar Town" and wrote for "Scrubs." Royce was a producer for "Everybody Loves Raymond" and "Men of a Certain Age."

The goal with "Enlisted" was "to show, just like any good workplace comedy, how these people grow and bond and how they live their lives every day in this workplace," Royce said.

Trouble was, though Biegel grew up with two brothers and a father in the armed forces, neither he nor Royce had served in the military.

As a result, the pilot was sprinkled with inaccuracies. The soldiers' hair was too long. Their uniforms were not to code. They didn't salute senior officers when they should.

Leery of producing a show that was disrespectful, the "Enlisted" men reached out for help.

After the pilot was shot, they hired Greg Bishop, an advisor at Musa Military Entertainment Consulting, who viewed the show and found it ... lacking.

"There were a lot of things wrong with the pilot, not done out of disrespect, but done out of not knowing," Bishop said.

Bishop worked with the creators to make the show more authentic and also helped with publicity by reaching out to military members.

Changes to the show included perfecting the uniform (such as putting badges in the right place, and making sure actors wore their hats inside and outside) and helping with set details (including adding stock numbers on grease barrels that appear in the background).

It even meant putting some cast members through several days of a "mini boot camp" in El Paso.

The improvements in accuracy didn't make for a hit. The first of the season's 13 episodes averaged just 2.4 million viewers and got a weak rating of 0.7 in the advertiser-desired

18-to-49 demographic.

Military members and their families who were not pleased with the inaccuracies took to social media to complain.

A Facebook page, "Petition to Cancel TV Show Enlisted," reads: "This tv show is an insult to say the least to all military personnel. It satirizes our way of life and has no place on Fox or any other tv channel."

Biegel and Royce said Twitter also was full of people bashing the pilot.

So they took to social media to turn the show around.

"I probably contacted at least 200 military people on Twitter over direct message," Biegel said. "I would say, 'Hey, my name is Kevin. I created the show. Please give it another chance.'"

"It was a matter of going through every medium - blogs, podcasts, websites - to get in there and explain where we're coming from," Royce added.

After several episodes, the creators said their outreach effort and changes to fix the show have helped.

Fox officials said the show now has an average of 3.1 million viewers and a rating of 1.2 in the 18-to-49 demographic.

The show's Facebook page has more than 60,000 "likes," and the Twitter account has more than 7,000 followers.

Distributed by MCT Information Services

'Enlisted'

Airs 9 p.m. Fridays on WTXF-TV 29