move json extension to library