refactored code to use promises added delete card