change the restful API and remove some unuseful code