Added middleware for messages
Added middleware for storing messages in session