added a function to return json object simply. Also added scripts for testing from client.