add optional params
add exception
fix bugs
added logger
fix bugs
fix bugs
added middleware