Minor tidy-up
Moved reset code into apicommands module