Limits the beforeAndAfter call to the number of cards we need
Added a (small) class comment to UrlStateService