Added error entity and repo