REST refactor and some indentation fixes...