Code clean up and fixes

Removed bad code and tested link saves to db