Changes and fixes:

-fixed issue where index being passed to db should have been pointId.
-changed db to support 3 'statuses' -1:deleted,0:inactive,1:active)
-minor tweaks and security improvements