Barack Obama served for at least two years in office .
Politician Barack Obama represented the 13th District for three terms in the Illinois Senate from 1997 to 1998 , when he ran for the U.S. Senate .
Barack Obama