Add some mocks, enable unit test and fix async code.