Refactored the middleware parsing of enpoint paths for better matching up with configured api endpoints.  Also, streamlined and condensed the code considerably.  Added redis-based stats unit test and api endpoint test for retrieving stats via API call.