Make sure the state column has a default
Do not add nil states to a row if there is no state
API clean up