Rerfactored databases json wrapping.