Changed test file structure, implemented unit tests for public api