Changes to use api rest