Fixed bug with constructing REST url for messages