Added server-side exercise state machine + tests