Heavy refactoring of the rest handler and more additions to the readme about that API