generalized http response code, few bugfixes along