added endpoint function