Added JSON wrappers for database reads and writes.