adapting API to new rest library