changed from a writer interface to a simpler write response interace
generic error handler