Fix response content-type
Clean up
Introduce config handling