Refactored
WIP
Changed the way crigeria is extracted from query params
Some fixes