fix login
update gallery code to follow new api
update widget to follow new api
change the data returned by delete
fix delete on primary db
cleanup old files