refactor the POST on root method