Adding back endpoint type as parameter to function createPlan