def paginate_response(response, page, per_page):
    """
    Paginate the incoming response json vector, accordinlgly to page and
    per_page values
    :param response: The whole response text
    :param page: The selected page number
    :param per_page: How many response record per page
    :return: The number of specified response records of the selected page
    """
    if page is not None and per_page is not None:
        pg = int(page)
        ppg = int(per_page)
        return response[pg * ppg:(pg + 1) * ppg]
    else:
        return response