add schema information to models, improve and refactor some of the methods in api v2