implemented insertion to database from client side