changed an api to use in server