fix collection access with trailing slash

when collection path contains more than two elements (e.g. /api/v1/mycollection/) and a trailing slash, read/create operations fail to perform correctly