Fixed error when receiving the API as an argument