updating api to use interface