Merge dev_rest

This concludes the long fork, we should merge this soon.