Server side code refactor, updated with latest meanstack framework.