Increase the timeout variables. Added check to only adjust php time limit if it's lower than the time needed if the API requests do time out.