Add API doc and test.