Improved swagger support for payload and response types and response messages

This PR deals with generating swagger for:
* Payload types
* Response types
* Response message

It involves many changes to swagger generation, which I have tried using our app, but I understand it might take some time for you to test these out.

Let me know if you have any feedback.