start work on stats middleware. currently handles basic stats for routes