 Nonetheless, he would win election to nine terms, serving from 1831 until his death in 1848.Adams and Andrew Johnson are the only former presidents to serve in Congress.After winning election, Adams became affiliated with the Anti-Masonic Party, partly because the National Republican Party's leadership in Massachusetts included many of the former Federalists that Adams had clashed with earlier in his career.