Added logic that will be used by new endpoints to add and remove plans.