Added unit tests and integration tests