To avoid the dangers that Coast Survey personnel had faced during the Civil War of being executed as spies if captured by the enemy, the United States Coast and Geodetic Survey Corps was established on 22 May 1917, giving Coast and Geodetic Survey officers a commissioned status so that under the laws of war, they could not be executed as spies if they were captured while serving as surveyors on a battlefield during World War I. The creation of the Coast and Geodetic Survey Corps also ensured that in wartime a set of officers with technical skills in surveying could be assimilated rapidly into the United States armed forces so that their skills could be employed in military and naval work essential to the war effort. Before World War I ended in November 1918, over half of all Coast and Geodetic Survey Corps officers had served in the U.S. Army, U.S. Navy, or United States Marine Corps, performing duty as artillery orienteering officers, as minelaying officers in the North Sea (where they were involved in the laying of the North Sea Mine Barrage), as navigators aboard troop transports, as intelligence officers, and as officers on the staff of American Expeditionary Force commanding officer General John "Black Jack" Pershing.