Remove unused middleware
Add tests for authentication