Removed direct SQL usage from Statistics module. In order to
do that , WebUI and Content had to be modified as well