moved bottle queries to pyramid