added initial implementation of database and querying reverse index