update tests, add some basic functional test