                 let message = messages[messageId]
                 pthread_mutex_unlock(&self.mutexMessages)
                 if message != nil {
-                    responseBody = message!
+                    responseBody = "{\"id\":\"" + String(messageId) + "\", \"msg\":\"" + message! + "\"}"
                 } else {
                     throw HTTPCode.Status_404
                 }

                let message = messages.removeValueForKey(messageId)
                pthread_mutex_unlock(&self.mutexMessages)
                if  message != nil {
                    responseBody = message!
                } else {
                    throw HTTPCode.Status_404
                }

        else if (request.method == "GET") {

            pthread_mutex_lock(&self.mutexMessages)
            
            responseBody.appendContentsOf("[")
            for kvp in self.messages {
                //better use a json library when available on linux
                responseBody.appendContentsOf("{\"id\":\"" + String(kvp.0) + "\", \"msg\":\"" + kvp.1 + "\"},")
            }
            responseBody.appendContentsOf("]")
            pthread_mutex_unlock(&self.mutexMessages)
        } else {
            throw HTTPCode.Status_400
        }
        return Response<String>(headers:["Content-Type":"text/json"], content:responseBody)
    }
}

