added a function to get db stuff for frontend