       status_code = 200 # ok
       json_response = JSON.stringify msgs
 
-    res.writeHead status_code, JSON_CONTENT
+    res.writeHead status_code, {
+      "Content-Type": "application/json"
+      "Pragma": "no-cache"
+      "Cache-Control": "s-maxage=0, max-age=0, must-revalidate, no-cache"
+    }
+
     console.log "Response: #{json_response}"
     res.end json_response
     

      else
        json_response = JSON.stringify {result: "All text messages deleted from DB"}

      res.writeHead status_code, JSON_CONTENT
      console.log "Response: #{json_response}"
      res.end json_response
  else
    status_code = 401 # unauthorized
    json_response = JSON.stringify {result: "Not an authorized action, sorry."}

    res.writeHead status_code, JSON_CONTENT
    console.log "Response: #{json_response}"
    res.end json_response
    else
      json_response = JSON.stringify {saved_message: msg}

    res.writeHead status_code, {"Content-Type": "application/json"}
    console.log "Response: #{json_response}"
    res.end json_response

