* Added missing NULL checks and corrected API return values as per validation * Added missing NULL checks