update basic api connection stuff to be enterprise grade