update docs and comments
add site type to db
whitespace
handle db errors properly