Refactor

refactor code by parameter, restful-wrap.
add test for `controllers/api/posts.js`
add travis-ci