updated to new json api