Updated getparam function and created spec test