changed file_exists to is_file and is_dir
added request forwarding feature