feat: add middleware validation #1