Added basic API error handling tests