use single quotes
better variables name
fix variable naming style
fix reponse type determination algorithm
this should lay the ground far a basic plugin system