Democracy ... legal coup de etat every two/four/six years depending on office type. Yeah, hate that democracy thing. A perpetual Obama dictatorship is so much better. Democracy ... per Salafists, we will get into office using democracy, then cancel all democracy in favor of Sharia, which doesn't allow democracy. Question: Why do Democrats ally with Muslims?
There are all sorts of legal systems to secure a "finality" to a vote in the US. The best and most usual is ... both parties cheat, but they cancel each other out or the cheating is too small to make a difference. Then one side wins big enough it is obviously certifiable by the various boards of elections. The Media does not declare any winners ... that would be stupid. But they have been doing this since the 1800 election (first one with parties).
In the event that there is too much cheating, or the winner is unclear, there are legal provisions for that eventuality. That is also part of the law. As long as you follow the law (even while cheating ... see any pro sport) it isn't a coup de etat, it is a normal change of representative. Even in the case of Gore vs Bush (because SCOTUS). If you threaten boards of elections or threaten lawyers or threaten judges, that is a coup de etat on a small scale. Democrats are good at that (see 1860).
One situation is someone burns up all the paper votes before they are counted ... what to do? Each state has their own rules (we are not the Soviet Union). The election isn't certified (if the board of elections is doing their job). What if the board of elections doesn't do their job? In America we file lawsuits (we don't Burn Loot Murder). What if an elected official doesn't do their job? We impeach them, including judges (like could happen to Judge Sullivan in the Flynn case). Judge Sullivan is loyal to Obama, not to the Constitution. We also have appeals courts and supreme courts at state and national levels ... and state level can lead to SCOTUS, which has the final say (until Congress decides otherwise).
Since Congress decides over SCOTUS in cases of legitimate legislation (SCOTUS decides on abusive law or abusive Executive) that is why the ultimate break the glass is "state delegation vote" in Congress (not by individual reps). The states stand in the way of tyranny from Washington DC. This failed in 1860, because the Democrats (N & S) broke the system. Had they stayed in Union, it could be resolved by SCOTUS, which recognized that slavery was legal. And we would have burned all the "damn Yankees".