Handle the indexerror exception on create_order

LMS-2646
Use [JsonResponse](https://github.com/edx/edx-platform/blob/master/common/djangoapps/util/json_request.py#L29) instead