Added some missing files
Writing index and using db functions for client