Fix some vitalinfos api endpoints to use sqlalchemy