Added unit and integration tests