improved api behavior

Change-Id: I2527c15e8ae93e89a328de963b242c55abed43a3