Refactor view models to support json requests