Add tests
Cleanup and add tests for process_request