Updated Error handling, Updated API test interface.