Added config handler
Added configuration method and default config
added custom errors
added api handler class