Fix things.

- Use cors module for cors.
- Fix status change on server.
- Fix xhr object vs function problem.
- Remove dirty model in read method.