This week is Sunshine Week, an annual celebration of the right of historians, journalists and all Americans to access government information.

Perhaps the most important tool enabling Americans to ensure that their government is open and, therefore, accountable, is the Freedom of Information Act, a 52-year-old law that requires the federal government to release nonexempt information when it is requested. Even our most secret agency, the CIA, has provided online access to 13 million pages of historical records thanks to FOIA. Such documents are powerful and illuminating. For example, recent requests have revealed that the Interior Department awarded nearly 1,700 offshore drilling safety exemptions, gutting Obama administration safety rules put in place after the 2010 BP Deepwater Horizon ecological disaster. Others have proved that President Trump lied about the size of his inauguration crowd.

But despite FOIA’s power and importance, the administration of the law is deeply flawed. The government’s oldest pending FOIA request has been languishing for almost 25 years, and there are 111,334 FOIA requests waiting — a mountainous backlog. At many agencies, despite the law’s requirement for a response within 20 business days, FOIA requests are rarely processed within a year. Once processed, many requests are often unusable because of gratuitous redaction by agency censors. If anything, this problem is only getting worse. This week, the Associated Press reported that our government, “censored, withheld or said it couldn’t find records sought by citizens, journalists and others more often last year than at any point in the past decade.”

Inadequacies such as allowing for over-redaction and lengthy waits shaped FOIA legislation from the moment that the House Committee on Government Operations began studying the issue of executive-branch secrecy in 1955. And these failings matter. A government that so dismally follows the law requiring it to grant citizens access to information is a government that citizens can’t easily trust. And in such a system, officials may act with impunity, knowing that the public faces a steep climb to gain the information necessary to insist upon accountability.

One major flaw in FOIA stems from charging the Justice Department with overseeing it. The department was a staunch opponent of FOIA legislation throughout the decade-plus that the bill was formed and negotiated. This opposition held even as the bill — championed by the late-Rep. John Moss (D-Calif.) — gained popular support in Congress, and as news editors led a coordinated campaign championing the public’s “right to know.”

An August 1965 Bureau of the Budget analysis revealed that the Justice Department believed the bill was actually unconstitutional, and further complained that “the requirement that information be made available to all and sundry, including the idly curious, could create serious practical problems for the agencies.”

When Lyndon B. Johnson signed the Freedom of Information Act into law on July 4, 1966, the president, normally a fan of flashy signing ceremonies, did so unhappily in private, personally handwriting “no ceremony” in response to a memo suggesting a public event. Johnson’s press secretary, Bill Moyers, later recounted: “I knew that LBJ had to be dragged kicking and screaming to the signing. He hated the very idea of the Freedom of Information Act; hated the thought of journalists rummaging in government closets and opening government files; hated them challenging the official view of reality.”

At the suggestion of the Justice Department, Johnson added a signing statement that undercut the intent of the law with warnings about the danger of the disclosure of military secrets, investigative files, executive privilege and confidential advice. The signing statement’s initial flowery conclusion reminded that “the decisions and policies — as well as the mistakes — of public officials are always subjected to the scrutiny and judgments of the people.” But it was scratched out, and Johnson did not even pay lip service to the idea of transparency.

While serving in the House, Donald H. Rumsfeld co-sponsored FOIA and Gerald Ford voted in favor of the law. But their positions changed when they rose to power in the executive branch. In fact, in the aftermath of President Richard Nixon’s scandals, when Congress passed FOIA amendments that drastically strengthened the law in 1974, then-President Ford — urged on by his chief of staff, Rumsfeld, and Rumsfeld’s deputy, Richard B. Cheney — vetoed the bill. The head of the Justice Department’s office of legal counsel, future Supreme Court justice Antonin Scalia, took an active role fighting FOIA reform. Scalia urged the director of the CIA and other high-ranking officials to “move quickly to make their view [supporting the veto] known directly to the president.”

But the House overrode Ford’s veto 371-31 and the Senate 65-27. One reason the White House lost was that the administration refused to negotiate with Congress on a mutually acceptable compromise. According to a June 1974 FBI memorandum, “the Office of Legislative Affairs at the White House [wanted] no changes made in this legislation since they want it to remain as bad as possible,” to better justify a veto.

But “as bad as possible” had long-term consequences, undermining the implementation of FOIA. The amendments allowed the Justice Department to remain in control of FOIA, and under its stewardship, fees were assessed — often illegally — to deter requesters from filing FOIAs. Case law also was established that allowed agencies to blow by the statute’s requirement that FOIA requests be processed within 20 working days, and agencies implemented a practice of hiding embarrassing information under the “deliberative process” exemption.

Forty years later, another FOIA reform bill was proposed to ameliorate some of these flaws. Once again, however, the Justice Department “strongly opposed passage” of reform throughout the Obama administration, even working to oppose the codification of the president’s own instructions to agencies to act with the “presumption of openness.”

But the Justice Department lost this battle, and Congress passed FOIA reform in 2016. The law now forbids the withholding of many historical documents and requires agencies to identify a specific “foreseeable harm” before withholding most current records.

Despite these reforms, the law remains a potentially powerful but systematically hindered tool. FOIA officials are often underfunded, ignored and even maligned. A State Department official recently told the Hill, “The FOIA office was always the punchline of a joke around here”; another official said that being sent to the department’s FOIA office “is like being reassigned to ‘Siberia.’” Critically, FOIA officials often must run their decisions past political appointees at their agencies.

The primary reason for the law’s failings can be traced to its oversight by the Justice Department, which views itself primarily as the protector of executive branch prerogatives rather than a promoter of openness. When agencies’ desires for secrecy conflict with FOIA, Justice does not go out of its way to ensure that the public’s right to know triumphs. In a sure sign of conflict, the same department charged with enforcing FOIA also defends agencies in court when they are sued for breaking the law. It was Justice Department lawyers that recently argued that a CIA history of the Bay of Pigs invasion should remain secret because “it could confuse the public.” There is a feeling among requesters that Justice does little more than set bare minimum FOIA benchmarks that agencies are “encouraged” to meet.

During a time in which the president has claimed that in the case of public information “the public means the enemy,” Congress must ensure that its law protecting the public’s access to information is being followed. To reduce FOIA delays and the over-redaction of documents, Congress must develop a mechanism to force agencies to actually comply with the Freedom of Information Act, a law that underpins our commitment to open, accountable government.

This post has been updated.