Fixed errors in lib/models.py where when not returning a dict (old projects ask for returning a list instead of dict) the code gave an error and failed.