added logging and the rest of the REST endpoints