Add error callback and complete callback unit tests