fix swagger var scope problem

`var swagger` was defined twice and causing scoping issues. This adds the ability to pass in "responseMessages" during configuration.