added json support
added api auth support