Fixed bug when res.end() is fired two times because a promise returns without data