Initial implementation multitasking JB, also variouse fix for memory leaks in activity manager
update api
fix another memory leaks