Changes according to the new API

Signed-off-by: Umair Khan <omerjerk@gmail.com>