prepare for unit and e2e test
add unit tests