Amend to api to make accomodate unittest