Helpers to call restful apis