     var reason = "Authentication";
 
     do {
-      let json = try NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments)
+      let json = try NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments);
       if let clientId = json["clientId"] as? String {
         reason = clientId;
       }
     } catch {
-      print("error serializing JSON: \(error)")
+      pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: "error serializing JSON: \(error)");
     }
 
     authenticationContext.evaluatePolicy(


  func isAvailable(command: CDVInvokedUrlCommand){
    let authenticationContext = LAContext();
    var error:NSError?

    let available = authenticationContext.canEvaluatePolicy(.DeviceOwnerAuthenticationWithBiometrics, error: &error);

    var statusCode = CDVCommandStatus_ERROR;
    var message = "Not available"
    if(available){
      statusCode = CDVCommandStatus_OK;
      message = "available";
    }

    let pluginResult = CDVPluginResult(status: statusCode, messageAsString: message);
    commandDelegate.sendPluginResult(pluginResult, callbackId:command.callbackId);
  }


        }else {
          // Check if there is an error
          if let error = error {
            let erroCode = String(error.code);
            pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: "Error: \(errorCode)");
          }
        }
      });
