rewritting API to be more like superagent