adding test and correcting empty request scenario