private void SignInWithEmail(string email, string password, System.Action <Exception> callback)
    {
        RestClient.Request(new RequestHelper
        {
            Uri    = signInBaseEndpoint + ApiKey,
            Method = "POST",
            Params = new Dictionary <string, string>
            {
                { "email", email },
                { "password", password }
            },
            IgnoreHttpException = true
        }).Then(response => {
            _firebaseSignResponse = JsonUtility.FromJson <FirebaseSignResponse>(response.Text);
            if (response.StatusCode == 200)
            {
                // When I sign in using an email, I still need to get the username of the signed in person
                // Sign in with email is successful, so we call the callback with no error
                callback(null);
            }
            else
            {
                FirebaseError firebaseError = JsonUtility.FromJson <FirebaseError>(response.Text);
                if (firebaseError.error.message == "EMAIL_NOT_FOUND")
                {
                    firebaseError.error.message = "Email Not Found";
                }

                if (firebaseError.error.message == "INVALID_PASSWORD")
                {
                    firebaseError.error.message = "Invalid Password";
                }

                callback(new Exception(firebaseError.error.message));
            }
        }).Catch(e => {
            callback(e);
        });
    }
    public void SignUpWithEmailAndPassword(UserInLocal userInLocal, System.Action <Exception> callback)
    {
        RestClient.Request(new RequestHelper
        {
            Uri    = signUpBaseEndpoint + ApiKey,
            Method = "Post",
            Params = new Dictionary <string, string>
            {
                { "email", userInLocal.email },
                { "password", userInLocal.password }
            },
            IgnoreHttpException = true
        }).Then(response => {
            FirebaseSignResponse firebaseSignResponse = JsonUtility.FromJson <FirebaseSignResponse>(response.Text);
            if (response.StatusCode == 200)
            {
                User user     = new User();
                user.Nickname = userInLocal.nickname;
                user.Email    = userInLocal.email;
                // Now we create an instance of the user in the database
                RestClient.Request(new RequestHelper
                {
                    Method = "PUT",
                    Uri    = DatabaseUrl + "UsersByNickname/" + user.Nickname + ".json",
                    Body   = user
                }).Then(responseFromUserCreation => {
                    if (firebaseSignResponse == null)
                    {
                        callback(new Exception("Couldn't create user instance"));
                    }
                    else
                    {
                        // Now we create another instance of the user, but now using his id as the identifier(This is necessary so we are able to retrieve the user nickname when he signs up using only his email)
                        RestClient.Request(new RequestHelper
                        {
                            Method = "PUT",
                            Uri    = DatabaseUrl + "UsersById/" + firebaseSignResponse.localId + ".json",
                            Body   = user
                        }).Then(responseFromUserByEmailCreation => {
                            callback(null);
                        }).Catch(e => {
                            callback(e);
                        });
                    }
                }).Catch(e => {
                    callback(e);
                });
            }
            else
            {
                FirebaseError firebaseError = JsonUtility.FromJson <FirebaseError>(response.Text);
                if (firebaseError.error.message == "EMAIL_EXISTS")
                {
                    firebaseError.error.message = "Email already exists";
                }

                callback(new Exception(firebaseError.error.message));
            }
        }).Catch(e => {
            callback(e);
        });
    }