Added app.api.onSuccess hook