move debug logging from PUT view to model.