extract HttpKernel into its own class
work on error handling, use sapi constant