Fixed checkapi routine.