added error middleware, fix broken error res' and uuid count