Refactored out view queries to rest_view.go file.