Shezanne Cassim and several friends who made and uploaded a comedy video to YouTube were eventually tried and convicted of endangering national security under the UAE's recently introduced cyber-crimes act.

They were released just a few days before a high-profile BBC interview in January 2014 between Jon Sopel and the ruler of Dubai and Prime Minister of the UAE, Sheikh Mohammed bin Rashed al Maktoum.

In that interview, Sheikh Mohammed acknowledged that mistakes had been made in the case.

In March this year, Mr Cassim made an appeal directly to the president of the UAE, Sheikh Khalifa bin Zayed al Nahyan. He also sent a copy to the UAE ambassador in Washington.

The Funny or Die film included pleas for Mr Cassim's release by several high-profile comedians.

Mr Ferrell said: "We are submitting this in support of Shez and his eventual freeing from being wrongly jailed."

And whilst Mr Cassim faced a potentially very long jail sentence, a few weeks after the #freeshez campaign which started around nine months after he was jailed - he was convicted and released for time already served.

It's not the first time this has happened in the UAE on a high-profile story.

But not so for Mr Cassim. A spent conviction means no return to his home Dubai in the UAE - ever. After being released and deported to the US early last year, Mr Cassim and his family have chosen to speak for the first time on camera about the case to BBC News.

He said: "Conditions in the jail were just terrible. There were around 130 inmates and only three toilets. And none of those toilets flushed."

He added: "We gave our souls to that city, and to be treated this way is something that has been incredibly difficult to deal with."

The impact on the family - who spent the majority of their lives working in Dubai - has been huge. Defending Mr Cassim has cost more than just their savings, said his mother Jean.

"I can't remember a night that I had a good night's rest," she said. "For some reason, I'm still scared. There are times I still go back to his room to make sure that he's still around with us. And that scare I think is going to last for the rest of my life."

Legal work

And since his return to the US, Mr Cassim has tried to put his difficulties behind him.

"He was denied access to counsel, he was made to sign a statement that was written in Arabic, and he didn't understand it, so essentially it was a false confession. He was not advised of the charges against him until five months into his detention."

Mr Cassim is now seeking a pardon and restitution.

Last January, Dubai's ruler Sheikh Mohammed acknowledged to the BBC's Jon Sopel, just a few days after Mr Cassim's release, that mistakes had been made in his case.

During the interview, Mr Sopel said: "The kid said: 'I did nothing wrong, we had no idea of what our crime was, we had no idea how long we'd be in prison for. We weren't actually told what our crime was until five months later after we were taken in'. Now, for a modern country, which you strive to be, is that satisfactory?"

Sheikh Mohammed responded: "No, we try to change it, we are not perfect, and we try to change it. Any mistakes, any things, we go in and we try to change it. We are not perfect, but we are doing our best."

Help could come because Eid-al-Fitr, the end of the holy month of Ramadan, is traditionally a time for pardons to be given in the UAE.

Earlier this week, the BBC reached out through several channels to Sheikh Mohammed, to ask if the government would be prepared to give Mr Cassim the pardon he's seeking.

The Funny or Die film included pleas for Mr Cassim's release by several high-profile comedians.

Mr Ferrell said: "We are submitting this in support of Shez and his eventual freeing from being wrongly jailed."

And whilst Mr Cassim faced a potentially very long jail sentence, a few weeks after the #freeshez campaign which started around nine months after he was jailed - he was convicted and released for time already served.

It's not the first time this has happened in the UAE on a high-profile story.

Others include a road rage incident, in which a man was held under the cyber-crimes act for uploading a video of an apparent assault to YouTube.

The uploader faced charges with a potential jail sentence twice as long as the maximum faced by the local citizen he had filmed repeatedly hitting an Indian van driver.

Then there was an American who was jailed amid a dispute about sick leave. His alleged crime involved defamation of his employer, by commenting on the dispute on social media.

In both those cases, all charges were eventually dropped.

But not so for Mr Cassim. A spent conviction means no return to his home Dubai in the UAE - ever. After being released and deported to the US early last year, Mr Cassim and his family have chosen to speak for the first time on camera about the case to BBC News.

He said: "Conditions in the jail were just terrible. There were around 130 inmates and only three toilets. And none of those toilets flushed."

He added: "We gave our souls to that city, and to be treated this way is something that has been incredibly difficult to deal with."

The impact on the family - who spent the majority of their lives working in Dubai - has been huge. Defending Mr Cassim has cost more than just their savings, said his mother Jean.

"I can't remember a night that I had a good night's rest," she said. "For some reason, I'm still scared. There are times I still go back to his room to make sure that he's still around with us. And that scare I think is going to last for the rest of my life."

While the UAE office of DLA Piper, who represented Mr Cassim, declined to comment, his US lawyer Susan Burns explained her concerns.

Lawyers working for Mr Cassim claim there were irregularities in the case.

"He was denied access to counsel, he was made to sign a statement that was written in Arabic, and he didn't understand it, so essentially it was a false confession. He was not advised of the charges against him until five months into his detention."

Last January, Dubai's ruler Sheikh Mohammed acknowledged to the BBC's Jon Sopel, just a few days after Mr Cassim's release, that mistakes had been made in his case.

During the interview, Mr Sopel said: "The kid said: 'I did nothing wrong, we had no idea of what our crime was, we had no idea how long we'd be in prison for. We weren't actually told what our crime was until five months later after we were taken in'. Now, for a modern country, which you strive to be, is that satisfactory?"

Sheikh Mohammed responded: "No, we try to change it, we are not perfect, and we try to change it. Any mistakes, any things, we go in and we try to change it. We are not perfect, but we are doing our best."

Help could come because Eid-al-Fitr, the end of the holy month of Ramadan, is traditionally a time for pardons to be given in the UAE.