Congress of the Confederation
In 1784 he was appointed Collector of the Port of New York by the Congress of the Confederation, and retained the post during the Washington administration. His next role involved dealing with the ongoing threat of Barbary pirates to American commerce.