I have a middleware that it should send the request to a function, wait for it to finish and send back to the client what that function returns. the problem is I dont figure