Fix bug when listing messages in api
Merge pull request #181 from pksunkara/listing_messages_api

Fix bug when listing messages in api