[apiserver] refactored for better thread safety;

Conflicts:
	Core/src/sources/apiserver/ApiServerComponent.cpp
[constraint scheduler] fixed possible segfault;
[apiserver] fixed apiserver component (multithreading);