add test for success and error