added and tested database add entry

Also fixed database saved null result in the search
Tests pass for developed units so far.