update schema
refactor(API): encapsulate unit states