         if let sessionTask = activeSessionTask {
             sessionTask.cancel()
         }
-       
+
         let session = NSURLSession.sharedSession()
         activeSessionTask = session.dataTaskWithRequest(request) { (data, response, error) in
             if let httpResponse = response as? NSHTTPURLResponse

    private func loadResponse(response: String) {
        let serializedResponse = JSONStringify(response)
        webView.evaluateJavaScript("Turbolinks.controller.loadResponse(\(serializedResponse))", completionHandler: nil)
    }
    
    private func navigateToLocation(location: NSURL) {

        webView.evaluateJavaScript("Turbolinks.controller.history.push(\(serializedURL))", completionHandler: nil)
    }
    
    private func responseDidLoad() {
        hideLoadingIndicator()
    }

    // MARK: Loading Indicator

    private func showLoadingIndicator() {
        view.addSubview(loadingIndicator)
        view.addConstraint(NSLayoutConstraint(item: loadingIndicator, attribute: .CenterX, relatedBy: .Equal, toItem: view, attribute: .CenterX, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: loadingIndicator, attribute: .CenterY, relatedBy: .Equal, toItem: view, attribute: .CenterY, multiplier: 1, constant: 0))

        webView.alpha = 0
        loadingIndicator.startAnimating()
    }

    private func hideLoadingIndicator() {
        UIView.animateWithDuration(0.2, animations: { () -> Void in
            self.loadingIndicator.alpha = 0
            self.webView.alpha = 1
        }, completion: { (_) -> Void in
            self.loadingIndicator.removeFromSuperview()
            self.loadingIndicator.alpha = 1
        })
    }

    // MARK: WKNavigationDelegate

    func webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) {
        responseDidLoad()
    }

    // MARK: WebViewControllerNavigationDelegate

    func visitLocation(location: NSURL) {
        let webViewController = WebViewController()
