script improvements

improved the script to work with CRUD operations along with select
operation that returns a json object