                 
                 self.accessToken = session.accessToken
                 
-                successHandler()
+                successHandler?()
             },
              failureHandler: { (errorResponse) in
                 print("Error while logging to SpaceDog: \(errorResponse.error?.message)")
-                failureHandler()
+                failureHandler?()
             }
         )
     }

            else {
                res = Mapper<SDResponse>().map(response.result.value)
            }
            failureHandler(res)
        }
    }

    init() {
    }
    
    public func login(username: String, password: String, successHandler: ((Void) -> Void)? = nil, failureHandler: ((Void) -> Void)? = nil) {
        guard appName != nil else {
            print(APP_NAME_MANDATORY_ERROR)
            return
