Move API calls to header file