added json api for chains