Added preliminary try-catch to API.