Added integration test framework and proper error handling