Made error response independent from entities