add unit test structure and some minor changes to the Security service
add unit test structure and some minor changes to the Security service