Response.json should execute after foreach loop completes its execution

```js
var todoarr = (req.body.data) ? req.body.data : undefined
    todoarr.forEach(function(element) {
         if(element.done == true) {
             TodoService.removeTodo(element, function(success) {
             });   
         }
        }); 
        res.json("success");
```