changed endpoint function return