added rest api functionality