Fix two return values
Use states
Implement pause / resume support