add application master tests
add state checking in node manager api
add tests for node manager