Improve restful security measures

fix #6