[PT 49369103] Merge 'RESTful api' back to master branch

1. pass 'rake spec' both on sqlite and postgresql in local box
2. pass 'RESTful api test' by invoking 'tools/client.rb'
3. manually check UI view, it's OK