Artificial intelligent assistant

Do antigens protrude through the capsule/slime layer in prokaryotic organisms where these features are present? In prokaryotic organisms that have a slime layer or capsule, do intrinsic/extrinsic proteins and other molecules that could be used as antigens protrude through the capsule? !Diagram of typical Gram +ve prokaryote I assume that they must in order to maintain their function for the cell, yet am struggling to suggest another way in which the presence of a capsule/slime layer could serve as a defence against phagocytosis? Unless the slime layer directly resists lysosomal activity _after_ the pathogen has been recognised and engulfed? On a related note, could the flagella of an organism (which must protrude through the capsule as above) trigger an immune response on its own?

They don't have to -- there are times in life of a bacteria (cell division, hunger, mutations, attacks of lysozyme and other enzymes, cell lysis) when any possible antigen gets less or more exposed.

About escaping phagocitosis, there are numerous strategies to achieve it -- from forming a large slime-covered colony, through killing or disabling phagocytes up to stopping digestion, escaping the phagocyte back to the environment or even living inside it ( _Listeria monocytogenes_ is a prime example -- it can even directly move from one cell to another).
EDIT: Here is a nice overview.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5eef046ea4624daa309a2c876f896039