     }
     switch parsedBody {
 			case .json(let json):
+				if !isCorrectPassword(json: json) {
+					try response.send(status: HTTPStatusCode.unauthorized).end()
+					return
+				}
 				let event = parseEvent(json: json)
 				try event.save()
 				response.send("Successfully added your event to the database\n")

    }
    next()
  }

	static func parseEvent(json : JSON) -> GeneralEvent {
		let title = json["title"].stringValue

import KituraNet
import SwiftyJSON
import Foundation
import DotEnv

struct EventApiController {
  static var handler: RouterHandler = { request, response, next in
