I'm building a rest api server that I will use with an angularjs frontend. I am trying to implement some middleware that runs on every request. For every request I want to check for an api token if present continuing checking if valid, if not present then return an unauthorized response without finishing the request.I'm building a rest api server that I will use