Update base.py

Added JSON support.