implementing response struct. added constructor for new error response