Implement defects view
Implement defect view by id
Optimize querying