added DB input sanitization in each function that touches the database
with outside data