change api to not be a single function