Add test suite for validating requests
Fix compilation error
Refactor + bug fixes