I would deliberately avoid using the REST API for this and go straight to the database. The tables you are looking for are the CDR and CEL tables in the asteriskcdrdb database. Just go straight to the source and grab the data that way. If you modify the permissions on the table, you can even set it up so that you can pull the data from other servers.