Added if clause to prevent fatal error due to missing primary key in data.
Fixed category issue.
Fixed undefined index issue.
Added if clause to prevent fatal error.
Optimized SQL query and fixed getStatus method.
Added if clause to set the author ID if not available.