fixed the django-rest-framework view set and serializer

fixed the django-rest-framework view set and serializer so that tp #677 doesn't introduce bugs