#479 WebAPI modifications, small refactoring