refactor backend api get weeks