Added tests to for the json api.