why is this generic and then there are `if request.method = 'PUT'` in the method?