Change way of getting database

Add a DATABASE variable, so other functions wouldn't be vunerable for stupid typos.