Avalanche Photodiodes As Single Photon Detectors