finish Restful API and some other stuff