an optional index can be provided to where middleware to only fetch one item