Added queries to retrieve activities filtered by type

TODO: possibly unify some of the repeated code