[api] fix test case after resetting auth correctly
[api] move two unit tests to unit test directory