By default Rest APi calls fails if the SharePoint portal is configured for anonymous access.
This is due to the fact that the ViewFormPagesLockDown Feature (Site Collection) in SharePoint 2013 is activated and visible by default. This was not the case with previous versions of SharePoint.
Following settings needs to be done to overcome this issue
Please navigate to Site collection settings and deactivate the feature "Limited Access user permission lockdown mode"
Assumption:- Already anonymous access has been configured at central admin level and other required libraries as and where required.