Modified to use django-rest-framework rather than django-tastypie.