Completed client side code and and added db support