DB insertion fixes

Data base insertion fixes.
Fixed json presentation for send to and file links.
File links to direct files.
auto update when sending message