Added more view controller extensions and error handling - needs refactoring