Added view models and some error handling stuff