Refactored errors and responses struct definitions