General refactoring

Refactored some of the API calls and prepared some views