Indentation looks not super good for me in lot of places, check the different indentation between these two starting with "res.body" lines and the return one.