Database functionality implemented