fixed the issue that caused jasmine test to fail, and revise api exposed. 

How about we can add a typescript type for it?