Handling errors in Core Web API