Why did Congress pass the Espionage Act in 1917 and the Sedition Act in 1918?

to suppress resistance to the government’s efforts to fight World War I
to persuade U.S. citizens to support the United States’ entry into World War I
to provide a Constitutional basis for putting German-Americans in prison camps
to give the government authority to carry out secret attacks on the Central Powers