Add typing to api helper functions
Background
Currently we're lacking a lot of typing for core parts of the api. Especially two files are lacking from typing support:
src/datalayer/queries.py
src/api/v1/resources/workflow/helpers.py
Implementation
Add typing to these files.