made production work and refactored posts and topics controllers