fixed to work with django 1.5+ and newer django-rest-framework