This has database writing and retrieval working