reorganize json code to be in content/api.py