Add wrapper function to API calls + fixes