public CommunicationResponse DeleteShoppingItem([FromBody] DeleteShoppingItemRequest deleteShoppingItemRequest) { var response = new CommunicationResponse(); try { if (_userService.AuthenticateSession(Request.Headers["Authorization"].ToString()) == false) { response.AddError("The authorization credentails were invalid", ErrorCode.SESSION_INVALID); return(response); } _shoppingRepository.DeleteItem(deleteShoppingItemRequest.ShoppingItemId); response.Notifications = new List <string> { "The shopping item has been deleted" }; } catch (ErrorCodeException exception) { response.AddError($"An unexpected exception occured: {exception}", deleteShoppingItemRequest, exception.Code); } catch (Exception exception) { response.AddError($"An unexpected exception occured: {exception}", deleteShoppingItemRequest); } return(response); }