new api with time periods and optimized data return