plugin analytics now working. fix bug in ctrl and api.