lifted the api-only part from Tom Brenner's freeb to access freebase