finally got the json conversion working