complete DAO layer.
replace MySQL with PostgreSQL.
add API handler for query.
fix no return state bug of api function.
redirect all invaild url to home page.