Created new class for generating error responses.