1. updated the RESTful logic
2. refectored the the structure