updated messages definition in /routes/api.js
changed messages, and created threads.js
switch api's content under routes/api/ folder
fixed error in thread.js
added support for threads.getById