changes as suggested by @dianakhuang and @jbau

@chrisndodge Kindly review the changeset.

Thanks
Why not use the `JsonResponse` class defined in `common/djangoapps/util/json_request.py`? It's designed for precisely this use case.