Glass material not working properly... When I add a light source it makes these colored dots
Glass is prone to do that; those dots are technically called "fireflies". For your shader, I suggest adding volume effects, like volume absorption, to handle the inside of the glass, as typical shades only work with the surface without them (and actual glass is very volumetric). The rest of it is an artifact of ray casting, which you can typically get around by increasing the size of your light source, or lowering its intensity. 

Another possibility, if none of that helps enough, is to go to your rendering settings and reduce the number of bounces. Good luck!