refactor and add period create and update routes