use generic function for request handlers setup

\nalso address couple TODOs