Implemented a proper databse none of this document database rubbish