[Issue #363] changed the api

@KareemAliRahman