added time functionality

Handled errors better, and added a timeout to wait until making more API calls