It might help simplify some of these try catch callback blocks if you abstract this into formatResponse (just because you have some duplicate code here and I haven't seen a case when you don't have a try catch block around the formatResponse.