Refactor and add JSONresponse module