adding functions for using ghost db
modified APIs