Improved tests using XCTestExpectation
More APIs and tests