Added database functionality and geolocation