URI parsing

Parse URI from $_SERVER['REQUEST_URI']
Some fixes