Fixed database initialisation and added search