Move function closure checking to _unwrap function make it work with Django REST Framework APIView