Implemented a beforeRequest() method to all end points.