closes #1 - implement middleware for encoding parameters