switched response handler and added json library