REST api  calls handling