 TextMessage = require '../models/TextMessage'
 util = require 'util'
-
-JSON_CONTENT = {"Content-Type": "application/json"}
 
 module.exports.showAll = (req, res) ->
   console.log "GET to '/message/all'"

      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

