Completed final database function

database still is not working completed read returns null to the console