fixed problem in the error message for bad Content-Type; refactored request header validation into helper.coffee