api call fixes + tidy up logging