API and message handling for wechat in rails environment