Moved all serialization to JsonApi module.

Also cleaned up API by adding router.