Implement joi validation of query and path params. Fixes #936.