add method to insert measurement in database