updated to reflect changes to new endpoints
changed to only use inv_code, fixed some minor bugs