added login/logout api to request
added json api
Merge pull request #5 from aodag/api

Api