 import KituraNet
 import SwiftyJSON
 import Foundation
+import DotEnv
 
 struct EventApiController {
   static var handler: RouterHandler = { request, response, next in

    }
    switch parsedBody {
			case .json(let json):
				let event = parseEvent(json: json)
				try event.save()
				response.send("Successfully added your event to the database\n")

    }
    next()
  }

	static func isCorrectPassword(json: JSON) -> Bool {
		let password = json["password"].stringValue
		guard let realPassword = DotEnv.get("API_PASSWORD") else {
			return false
		}
		return password == realPassword
	}

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