Added changes to return JSON response