updated method for endpoint reset

Now using MySQL query for endpoint reset.
minor updates to all the things