Updated component functions and javascript

component functions now only return non-expired posts and a deelte
button is added to posts owned by the currently logged in user