implementing better way to handle token timeout, 401 and re-suthentication