Fixed indentation and added valid result for invalid API calls