handling multiple document uploads and responses in state management