dashboard activity queries api and some refactors