replace InvalidIdException with WebApplicationException and modified the test accoridingly