refactored functions directory
request handler
write handler function