HAVANA (AP) — Galo Beltran stands on the tarmac testing a hand-held baggage scanner. Each time a barcode is successfully read, he smiles.

The device, which is used to track luggage, is deployed at airports across the world. But until this moment, Beltran wasn't sure if it would work on Cuban cellular networks.

As satisfying as meeting that challenge was, there are hundreds more to be tackled as U.S. airlines prepare to resume their first regularly scheduled flights to Cuba in five decades. Collecting baggage fees in a country where most U.S. credit cards don't work, for instance. And solutions need to be found rapidly — airlines must start flights within three months of being granted a route by the U.S. government.

The Associated Press got exclusive access, joining American Airlines on a trip to Cuba to access the airports and meet with officials there.

"We have a good plan in place," says Beltran, a longtime American executive who is overseeing the airline's entrance into Cuba. "Even with the challenges, we have been able to look for loopholes."

Take the baggage scanner. While some U.S. cellphones do work in Cuba, the U.S. SIM card in the scanner wouldn't connect. So the airline found a workaround: get SIM cards from another country.

The Department of Transportation on Friday granted American and five other airlines permission to fly to nine Cuban cities. Normally, airlines spend up to a year preparing for new foreign markets. In this case, flights must start within 90 days of the government awarding the route. A decision is expected later this summer on the more-coveted — and contested — routes to Havana.

Airlines are racing to figure out how to offer the same streamlined service that is provided out of the U.S. Cuba's airports lack self-serve check-in kiosks. The terminal currently used by U.S.-bound charter flights has a tiny departure lobby and overflowing baggage belts. And all the workers are government employees, leading airlines to question if they will have a dedicated staff who can be trained in their policies and computer programs.

Andrew Watterson, senior vice president of network and revenue at Southwest Airlines, notes that the unique challenges of U.S. and Cuban regulations, along with the 90-day window to start operations, "leads to a high-pressure situation."

"The timelines don't fit all these extra complications," Watterson says.

Teams from American and JetBlue Airways have already visited Cuba. Next week, a delegation organized by Airlines for America, the industry's main trade and lobby group, will also head to the island nation.

All flights between the two countries today are charters, many operated by the carriers now seeking approval for scheduled service. American leads the group, flying 1,084 charter flights last year, followed by JetBlue with 221.

When flying the route on behalf of a charter company, the airlines don't have to worry about selling tickets, dealing with currency or many of the logistical challenges. But all of that becomes the airlines' responsibility once they start scheduled service.

The charter experience has provided some lessons on serving Cuba.

American and JetBlue, for instance, both fly in their own mechanics each day since Cuban maintenance providers haven't yet been certified by the U.S. Federal Aviation Administration.

But much is still unknown.

Internet speeds at airports are supposed to be at least 256 kilobytes a second — extremely slow but supposedly fast enough to process check-ins.

Then there is the unique cargo heading to Cuba. For instance, engine blocks are popular and, as JetBlue discovered, can be transported only if they never contained any flammable oils or fuel.

Airlines are finding they need special nomenclature. Consider visas. The Cuban government requires most visitors from the U.S. to have a "tourist visa." However, the U.S. government doesn't allow tourism to Cuba. Visitors must be on so-called cultural exchange trips. Airlines don't want to be in the middle of this political parsing of words, so they are talking about "visitor visas."

"With Cuba, we can't look at what other U.S. carriers have done," says Scott Laurence, senior vice president of airline planning at JetBlue. "We know we've got to be ready for a number of curveballs."

Most Americans cannot still legally visit Cuba. However the Obama administration has eased rules to the point where travelers are now free to design their own "people-to-people" cultural exchange tours with very little oversight. But airlines still need to record — and keep for five years — the official reason why somebody is traveling to Cuba. So reservation systems have been revamped to allow passengers to select one of the 12 permitted categories. They include family visits, official business, educational or religious activities.

U.S. citizens' interest in visiting Cuba has swelled since relations between the two nations started to thaw in December 2014. Nearly 160,000 U.S. leisure travelers flew to Cuba last year, along with hundreds of thousands of Cuban-Americans visiting family.

That's only likely to grow following an aviation agreement signed between the two nations in February that allows for up to 110 daily scheduled flights — more than five times the current charter operations.

Many travelers are excited for the change. Charters are often expensive and lack online booking or 24-hour customer service.

Hilda Costa and her husband Larry Costa of Wappingers Falls, New York, recently took a charter from New York to Havana to visit her family.

"When you go through the travel agencies, it's a lot of money that they charge you," she says. "I can't wait for the day they have regular airline service."

Costa paid $859 a person, not including luggage fees: usually $25 a bag plus $2 or $3 for each pound over 44 pounds.

Most travelers to Cuba check multiple items, bringing supplies and flat-screen TVs to loved ones. Often, they pack in plastic bags or cardboard boxes to minimize weight and fees. That however creates a logistical headache for airlines since the packaging is more likely to rupture in transit.

Cuba has already seen startling growth in aviation. Last year, 18 percent more passengers flew there than in 2014, according to government aviation officials.

Currently, 46 airlines fly to Cuba including Air France, Aeromexico, KLM, Air Canada, Aeroflot and Iberia. But none of them fly from countries that still have a trade embargo with Cuba. Now, thanks to an easing of regulations under the Obama administration, U.S. airlines are about to add to that mix.

"The problem is it's ten all at one time. The others have all come little by little," says Mayda Molina Martinez, the Cuban government official responsible for relationships with U.S. airlines. "Every day, every hour, every minute, somebody calls me, somebody emails me."

Cuban aviation officials say they are ready for the extra flights but questions remain, especially at Havana's airport.

Currently, all U.S. charters arrive at Terminal 2 where passengers must use stairs to exit planes and then walk or take buses to the terminal. Airlines would prefer to use the more modern Terminal 3, which has eight jet bridges and is currently used by other foreign airlines.

Check-in involves one long, snaking line for all U.S. flights, regardless of which airline passengers are flying. The same Cuban government workers process all flights. With the start of scheduled service, the U.S. carriers would prefer their own, dedicated staff — still Cuban government employees — handle check-in.

American, which has flown charters the longest, hopes to leverage its large Miami hub — home to the largest Cuban-American population — to its advantage. The Fort Worth, Texas-based airline has requested more routes and frequencies than any other U.S. carrier.

Everywhere Beltran went last week, he reminded Cuban officials of American's message: "We have kept our commitment of serving Cuba for 25 years nonstop." And told them that American would prefer to use the updated terminal.

"We will see," Martinez says of the terminal request. "There will always be somebody who isn't happy."