Fixed some stupid syntax errors and wrong use of request object