service state implementation

to resolve issue #2