added functions to get stored objects from database