add getting posts for a certain topic; move non-ui javascript codes to
topic.js