chown() file after checking that it was opened correctly
close() file after GET