     }
     
 
+    /**
+     Method authenticates user with facebook and returns the facebook user id and facebook user full name if authentication was a success, else it will return a FacebookAuthenticationError.
+     
+     - parameter callback: ((facebookUserId : String?, facebookUserFullName : String?, error : FacebookAuthenticationError?) -> ())
+     */
     private func authenticateFacebookUser(callback : ((facebookUserId : String?, facebookUserFullName : String?, error : FacebookAuthenticationError?) -> ())) {
         
         let authManager = BMSClient.sharedInstance.authorizationManager

                            callback(facebookUserId: userId, facebookUserFullName: fullName, error: nil)
                        }
                    }
                    else {
                        print("Valid Authentication Header and userIdentity, but id not found")
                        callback(facebookUserId: nil, facebookUserFullName: nil, error: FacebookAuthenticationError.FacebookUserIdNotFound)
                    }
                    
                }
                else {
                    print("Valid Authentication Header, but userIdentity not found. You have to configure one of the methods available in Advanced Mobile Service on Bluemix, such as Facebook")
                    callback(facebookUserId: nil, facebookUserFullName: nil, error: FacebookAuthenticationError.FacebookuserIdentifyNotFound)
                }

            }
            
        })
        
    }

                    callback(facebookUserId: nil, facebookUserFullName: nil, error: FacebookAuthenticationError.AuthenticationHeaderNotFound)
                }
            }
            //error is nil
            else {
                if let identity = authManager.userIdentity {
                    if let userId = identity.id  {
