Refactor the code of return json & xml
Create the Request Handler