added promises and sample controller