more flexible parsing
fixes for activities and rules manager
modify to support new API, some bug fixes