added an insert function and modified the delete function to return a json_object