Added tests for as_json and as_dict to unit tests