Implement a statistics HTTP server

This should be moved to right before the loop