Advanced http-cordova missing "onFail" callback function

I’m using the advanced-http cordova plugin. Followed all their steps in their github repo (

But when I try to run my code an error pops up:

missing mandatory "onFail" callback function

Here’s how my code looks like:'', {
        username: this.username, 
        password: this.password,
        firstname: this.firstname,
        middlename: this.middlename,
        lastname: this.lastname,
        birthday: this.birthday,
        age: this.age,
        address: this.address,
        prisoner: this.prisoner
    }, response => {
        try {
   = JSON.parse(;
            // prints test
          } catch(e) {
            console.error('JSON parsing error');
        }, response => {
          // prints 403

          //prints Permission denied

What am I missing here? :thinking: Please help