[mod] add general purpose JSON api