added period api and tests