API mode device reset removed, some cleanup and operation_mode introduced