Use getCategoryId() to get category id from request
Use try-with-resources to close the input stream
Add some 'static' keywords to methods
Fix some warnings mentioned by Eclipse