add json support for rest api