updated some error handling and how query string params are setup