Request params parsing, fixed memory leaks, code refactoring to match new convention