Refactored Database layer and added Sensor Management for users