building week interval from period in index for api