adding second function to get the next page
passing multipe types to the api call