ruby script is interacting with database, but having problems with parameters not proper JSON