Move code around slightly
Put requests into threads
Add limits to queries