Improved api calling