catch errors when trying to build analytics api