Adds state tracking and web interface